Gitlab Self Hosted to Jira Software

I am having difficulty with connecting my local gitlab server to Jira software.

I have followed all the documentation I can find but cannot seem to get it to link.

  1. Using the GitLab for Jira (gitlab.com) app from the Jira Marketplace
    • When entering https of my server, I get the error ‘Failed to update GitLab version. Please try again.’
    • When entering http of my server, it seems like it is working and shows the ‘sign in’ button, then followed by ‘Failed to load Jira Connect Application ID. Please try again.’
2 Likes

same problem here inserting in Jira the GitLab self-managed instance URL: “Failed to update GitLab version. Please try again.”

in console: PUT https://gitlab.com/-/jira_connect/installations 422 xhr.js:210

Same here as well request sent:

curl 'https://gitlab.com/-/jira_connect/installations' \
  -X 'PUT' \
  -H 'authority: gitlab.com' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
  -H 'content-type: application/json' \
  -H 'origin: https://gitlab.com' \
  -H 'referer: https://gitlab.com/-/jira_connect/subscriptions?xdm_e=https%3A%2F%2Fmyboard.atlassian.net&xdm_c=channel-gitlab-jira-connect-gitlab.com__gitlab-configuration&cp=&xdm_deprecated_addon_key_do_not_use=gitlab-jira-connect-gitlab.com&lic=none&cv=1001.0.0-SNAPSHOT&jwt=xxx' \
  -H 'sec-ch-ua: "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36' \
  --data-raw '{"jwt":"xxx","installation":{"instance_url":"xxx"}}' \
  --compressed

Response received:

{"errors":{"instance_url":["Could not be installed on the instance. Error response code 401"]}}

No explanation, why it cannot be installed, nothing.

And yes it works with http, but then you cannot login. Will check whether cloudflare has anything to do with it. Because it seems like request is proxied via gitlab.com.

But later on once you try to sing in to self-hosted gitlab, you get when this request runs:

curl 'http://gitlab.mydomain.com/-/jira_connect/oauth_application_id' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Referer;' \
  --compressed

this error:

Just tried to upgrade the GitLab server version to the latest release, but still had no luck in connecting to Jira.

Hi,
I was strugling with this too untill i found this documentation page
Adding Jira Connect Application ID solves the problem.
Remember that If your GitLab instance is self-managed, you must follow some extra steps to install the GitLab.com for Jira Cloud app, and your GitLab instance must be accessible by Jira.
If you have already tried installing App from Atlassian Marketplace the extra steps will fail and you have to follow this troubleshooting steps.

@savlin, thank you very much, followed guide you linked and moved forward to step:


Seems that extension is sending this link, without access_token and as a result no groups are found :frowning:

curl 'https://gitlab.mydomain.com/api/v4/groups?min_access_level=40&page=1&per_page=10&search=Development' \
  -H 'authority: gitlab.mydomain.com' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
  -H 'if-none-match: W/"4f53cda18c2baa0c0354bb5f9a3ecbe5"' \
  -H 'origin: https://gitlab.com' \
  -H 'referer: https://gitlab.com/' \
  -H 'sec-ch-ua: "Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36' \
  --compressed

Any ideas why this happens? Does gitlab.com proxy remove the header or it is not added by the code, that prepares the request. Can someone give me a link to this extensions latest version source code?

@savlin Hi, thank you very much, moved forward to namespace step with the help of the guide you linked:

Seems that Jira app is not adding access_token to following request, when searching for groups and always returns empty array.

curl 'https://gitlab.mydomain.com/api/v4/groups?min_access_level=40&page=1&per_page=10&search=Development' \
  -H 'authority: gitlab.mydomain.com' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
  -H 'if-none-match: W/"4f53cda18c2baa0c0354bb5f9a3ecbe5"' \
  -H 'origin: https://gitlab.com' \
  -H 'referer: https://gitlab.com/' \
  -H 'sec-ch-ua: "Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36' \
  --compressed

Wonder if the gitlab.com proxy removes this token header or something else is a miss or application does not add that header to gitlab group api search endpoint request?

Do you have link to source code of this Jira App?

You have to follow Install the GitLab.com for Jira Cloud app for self-managed instances step.