GitLab self-managed instance cannot connect to Jira Cloud - "Failed to link group. Please try again."

Summary

We had a Jira Cloud account with one team member that has all the administrator roles. Our GitLab self-managed instance (v 16.2) is integrated to this Jira Cloud by manual app installation via GitLab app descriptor.

I added an application in GitLab > Application where the callback URL is https://OUR INSTANCE/-/jira_connect/oauth_callbacks, and also where the Application ID was used in GitLab > Settings > General > GitLab for Jira > Jira Connect Application ID

After this setup I was able to go to Jira to setup the manually installed GitLab for Jira for our instance, and was able to successfully log-in, however, upon linking groups, I get an error.

It connects to this API: /api/v4/integrations/jira_connect/subscriptions It returns:

{ "message": "Could not fetch user information from Jira. Check the permissions in Jira and try again." }

Steps to reproduce

  1. Create an Application in GitLab and Set Jira Connect Application ID
  2. Create an API Token in Jira and add it in the Jira integration of GitLab group
  3. Put Jira Software to development mode.
  4. Upload the GitLab app descriptor and install the app.
  5. Sign in with GitLab for Jira (Self Managed App)
  6. Link a Group

Example Project

What is the current bug behavior?

It connects to this API: /api/v4/integrations/jira_connect/subscriptions It returns:

{ "message": "Could not fetch user information from Jira. Check the permissions in Jira and try again." }

Note: I also had this investigated with our Jira Cloud support and confirmed that all accesses of my account had all the organization/site administrator accesses.

What is the expected correct behavior?

It should link the group as what I have experienced with GitLab.com

Relevant logs and/or screenshots

image image

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Workaround

Create a group name with exactly "site-admins", and add the Jira site administrator into the group. This worked for several users based on Atlassian's forum.

Possible fixes

Edited by Daphne Kua