Add API endpoint for Jira issue configuration
Proposal:
Add endpoint for this portion so users can automate the configuration of a project:
- Enable Jira integration
- Configure the Jira project key
- Enable Jira issue creation from vulnerabilities
Verification steps
Prepare your Jira instance
- Sign up for a free account on atlassian.net
- Create a Jira project
- In the top-right corner go to
⚙️ -> Atlassian Account Settings -> Security -> Create and manage API tokens and create an API token
Validate that UI works as expected
- In a GitLab project, go to Settings -> Integrations and add a Jira Issues integration.
- Enter your Jira project URL
- Use basic auth and enter your email and API key
- Check Create Jira issues for vulnerabilities
- Enter your project key and select an issue type
- Submit
Validate that API works as expected
If you tested the UI, disable jira issues for vulnerabilities
- Create a GitLab PAT
- Run the curl command below:
curl -X PUT <gdk_url>/api/v4/projects/38/integrations/jira \
-H "Private-Token: ${GITLAB_TOKEN}" \
-d 'url=https://<project>.atlassian.net/' \
-d 'username=<username>' \
-d "password=${JIRA_TOKEN}" \
-d 'vulnerabilities_enabled=true' \
-d 'vulnerabilities_issuetype=10001'
Observe that vulnerabilities_enabled
and vulnerabilities_issuetype
are set.
Edited by Brian Williams