Skip to content

Make view Jira issues configurable via API

  • Please check this box if this contribution uses AI-generated content as outlined in the GitLab DCO & CLA

What does this MR do and why?

Make view Jira issues configurable via API, as discussed in this issue: #267015 (closed)

Integration API capability is often left behind (forgot to be added). So, there is another related issue in here that will make API capability automatically added alongside the "main feature". However, this MR is pretty small yet has a bit of demand, so it is worth to make changes using the old way.

Changelog: added

Notes

  1. In the documentation, the required column is slightly inconsistent between (true / false) and (yes / no). So I'm not too sure
  2. View Jira issues is intended for GitLab Premium users. I'm not sure if we need to handle some logic / validation related things in the API. Currently, I don't handle anything, as the feature itself (/-/integrations/jira/issues) has handled it properly.
  3. I saw another field such as jira_issue_transition_automatic, vulnerabilities_enabled, and vulnerabilities_issuetype. But I leave it as is.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Jira

Screenshot_2024-04-21_at_13.08.23

Screenshot_2024-04-30_at_17.31.56

GitLab

Before After
API PUT: API PUT:
Screenshot_2024-04-21_at_13.12.44 Screenshot_2024-04-30_at_17.24.31
API GET: API GET:
Screenshot_2024-04-21_at_13.13.17 Screenshot_2024-04-30_at_17.25.01
Config UI after API call: Config UI after API call:
Screenshot_2024-04-21_at_13.12.59 Screenshot_2024-04-30_at_17.25.31
View Jira issues list:
Screenshot_2024-04-30_at_17.25.51

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Setup Jira and the API token following this doc
  2. Enable feature flag jira_multiple_project_keys as it has been globally enabled in production:
gdk rails c

> Feature.enable(:jira_multiple_project_keys)
  1. Make a curl:
curl -s -XPUT http://127.0.0.1:3000/api/v4/projects/195/integrations/jira\?access_token\=glpat-a4VMoLzZEaz6UPe-1a2h \
   --header 'Content-Type: application/json' \
   --data '{"url":"https://your.atlassian.net","username":"your@example.com","password":"your-password","issues_enabled":true,"project_keys":["FOO", "KAN"]}'
  1. Check the configuration page: http://127.0.0.1:3000/<your-group>/<your-project>/-/settings/integrations/jira/edit
  2. Check the view Jira issues: http://127.0.0.1:3000/<your-group>/<your-project>/-/integrations/jira/issues
Edited by Ivan Sebastian

Merge request reports