Skip to content

Add API endpoint for Jira issue configuration

Proposal:

Add endpoint for this portion so users can automate the configuration of a project:

  1. Enable Jira integration
  2. Configure the Jira project key
  3. Enable Jira issue creation from vulnerabilities

image.png

image.png

Verification steps

Prepare your Jira instance

  1. Sign up for a free account on atlassian.net
  2. Create a Jira project
  3. 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

  1. In a GitLab project, go to Settings -> Integrations and add a Jira Issues integration.
  2. Enter your Jira project URL
  3. Use basic auth and enter your email and API key
  4. Check Create Jira issues for vulnerabilities
  5. Enter your project key and select an issue type
  6. Submit

Validate that API works as expected

If you tested the UI, disable jira issues for vulnerabilities

  1. Create a GitLab PAT
  2. 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