GitLab for Jira Cloud app: group picker fails on instances with a relative URL root
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
On a self-managed instance installed under a relative URL root (for example https://gitlab.example.com/gitlab), the group picker in the GitLab for Jira Cloud app fails to load. The modal shows "Failed to load groups. Please try again." and no groups can be linked.
The cause is that groups_path is handed to the frontend without the instance's relative_url_root prefix, while every sibling path in the same payload does carry it.
Steps to reproduce
- Install or configure a GitLab instance under a relative URL root, for example
external_url 'https://gitlab.example.com/gitlab'in/etc/gitlab/gitlab.rb. - Install the GitLab for Jira Cloud app in a Jira Cloud site and connect it to that instance.
- In Jira, go to Apps > Manage your apps > GitLab for Jira and open the app configuration page.
- Select Link groups.
- Observe the group list in the modal, and the network request it issues.
Example Project
Not reproducible on GitLab.com, which is not installed under a relative URL root. Reproducing requires a self-managed instance with relative_url_root configured.
What is the current bug behavior?
The group list is empty and the modal displays "Failed to load groups. Please try again."
The request goes to /api/v4/groups, which does not exist on an instance served under a subpath, so it returns 404:
GET https://gitlab.example.com/api/v4/groups?min_access_level=40&skip_groups=&page=1&per_page=10
=> 404 Not FoundThe data attribute rendered into the page shows the inconsistency directly. groups_path is missing the /gitlab prefix that subscriptions_path has:
data-groups-path="/api/v4/groups?skip_groups="
data-subscriptions-path="/gitlab/-/jira_connect/subscriptions.json"
data-gitlab-user-path="/gitlab/root"What is the expected correct behavior?
groups_path should carry the relative URL root like every other path in the payload, and the request should go to:
GET https://gitlab.example.com/gitlab/api/v4/groups?min_access_level=40&skip_groups=&page=1&per_page=10
=> 200 OKThe group picker should list groups and allow them to be linked.
Relevant logs and/or screenshots
Confirmed in the Rails console on an instance with relative_url_root set to /gitlab:
Gitlab.config.gitlab.relative_url_root
# => "/gitlab"
JiraConnect::AppDataSerializer.new(JiraConnectSubscription.limit(2).to_a).as_json
# => { groups_path: "/api/v4/groups?min_access_level=40&skip_groups=", # missing /gitlab
# subscriptions_path: "/gitlab/-/jira_connect/subscriptions", # correct
# ... }Output of checks
- GitLab version: 19.2.4-ce
- Installation type: Omnibus package
relative_url_root: /scm
ease use one of the issue templates provided and include as much information as possible.
Thank you for helping to make GitLab a better product.