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
- In the documentation, the
required
column is slightly inconsistent between (true
/false
) and (yes
/no
). So I'm not too sure - 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. - I saw another field such as
jira_issue_transition_automatic
,vulnerabilities_enabled,
andvulnerabilities_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
GitLab
Before | After |
---|---|
API PUT: | API PUT: |
API GET: | API GET: |
Config UI after API call: | Config UI after API call: |
View Jira issues list: | |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Setup Jira and the API token following this doc
- Enable feature flag
jira_multiple_project_keys
as it has been globally enabled in production:
gdk rails c
> Feature.enable(:jira_multiple_project_keys)
- 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"]}'
- Check the configuration page:
http://127.0.0.1:3000/<your-group>/<your-project>/-/settings/integrations/jira/edit
- Check the view Jira issues:
http://127.0.0.1:3000/<your-group>/<your-project>/-/integrations/jira/issues
Edited by Ivan Sebastian