> For the complete documentation index, see [llms.txt](https://help.usehaystack.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.usehaystack.io/setup/integrations/gitlab.md).

# GitLab

See all your teams work from JIRA issues to pull requests in once place by integrating Github with Haystack.

{% hint style="info" %}
For more information on what data Haystack uses from Gitlab, [here is an article!](/admin/security-and-privacy.md)
{% endhint %}

### For GitLab integrations, there are 3 high level steps <a href="#h_fdbbdd3724" id="h_fdbbdd3724"></a>

1. **Generate Personal Access Token**
2. **Provide Access Token to Haystack**
3. **(Only self-hosted) Open GitLab firewall to Haystack IPs**

You can find detailed instructions on each step below.

### 1. Generate Personal Access Token <a href="#h_a694d7f69c" id="h_a694d7f69c"></a>

You can [create as many personal access tokens](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) as you like from your GitLab profile.

1. Log in to GitLab.
2. In the upper-right corner, click your avatar and select Settings.
3. On the User Settings menu, select Access Tokens.
4. Choose a name and optional expiry date for the token - Don't set any date.
5. Choose the desired scopes - For Haystack we need only api scope and read\_user scope..
6. Click the Create personal access token button.
7. Save the personal access token somewhere safe. Once you leave or refresh the page, you won’t be able to access it again.

Here is the example:

<figure><img src="https://downloads.intercomcdn.com/i/o/449487822/3cd10e1e86f1d98c12a821ba/Screen+Shot+2022-01-17+at+3.21.01+PM.png" alt="" width="563"><figcaption></figcaption></figure>

### 2. Complete Filling Out Information on Haystack <a href="#h_cf91a75a3c" id="h_cf91a75a3c"></a>

<figure><img src="https://downloads.intercomcdn.com/i/o/907311855/bafe3108a1c4632c139f8664/Screenshot+2023-12-12+at+6.26.54%E2%80%AFPM.png" alt="" width="563"><figcaption></figcaption></figure>

Copy paste the newly generated token into Haystack.

Click "Connect" and you are all done if you are not using a self managed Gitlab instance.

{% hint style="info" %}
If you have a self managed Gitlab instance, please continue reading.
{% endhint %}

### 3. (Only self-managed) Open GitLab firewall to Haystack IPs <a href="#h_833ff6d687" id="h_833ff6d687"></a>

If you have a self managed Gitlab instance, you will need to open firewall access to the following IP addresses Haystack uses to connect to GitLab.

```
35.209.159.249
35.208.83.132
35.208.18.170
35.209.170.63
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.usehaystack.io/setup/integrations/gitlab.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
