Jira Cloud
Read time: 8 minutes
Last edited: Dec 14, 2024
Overview
This topic explains how LaunchDarkly's Jira Cloud integration allows you to link your feature flags to your team's Jira issues. When you connect a feature flag to a Jira issue, LaunchDarkly automatically creates a Jira flag link. To learn more, read Flag links.
The LaunchDarkly Jira integration is only for Jira Cloud product offerings. It does not work in Jira Data Center or Jira Server.
When a feature flag is turned on or off or has its targeting rules updated, its associated Jira issue pages display the flag's current status.
If you use Jira Cloud, you may use other Atlassian products. You can also set up integrations for those. To learn more, read about the LaunchDarkly integrations with Compass, Confluence, and Trello.
Prerequisites
To complete this procedure, you must have the following prerequisites:
- The LaunchDarkly for Jira app from the Atlassian Marketplace in your Jira Cloud instance.
- A personal or service API access token. To learn more, read API access tokens.
Set up the Jira integration
To set up the Jira integration, you must complete the following steps:
- Give your API access token the required permissions:
- You can create a custom role with webhook and flag link permissions, then add the custom role to a personal or service access token, or
- you can add the built-in Writer role to your personal access token.
This allows LaunchDarkly to communicate with Jira any time you change a flag.
Give your API access token the required permissions
You can create a custom role with appropriate permissions then add the custom role to a personal or service access token, or you can add the built-in Writer role to your personal access token.
If you configured the Jira integration prior to February 15, 2022, you may need to update your access token's custom role to include a statement allowing access to proj/*:env/*:flag/*
resources with the createFlagLink
, updateFlagLink
, and deleteFlagLink
actions.
Create a custom role and add it to an API access token
Expand Create a custom role and add it to an API access token
Service tokens and custom roles are only available to customers on select plans. To learn more, read about our pricing. To upgrade your plan, contact Sales.
To create a custom role for the API access token:
- Click the gear icon in the left sidenav to view Organization settings. The General settings page appears.
- Click Roles.
- Click Create role. The "Create custom role" panel appears.
- Give the custom role a human-readable name.
- In the "Role policy" section, enter
webhook/*
in the Choose resources for this policy statement field. - Select "Allow" from the Allow or deny actions on the resource menu.
- Choose
createWebhook
anddeleteWebhook
from the Choose actions to allow or deny menu. - Click Update statement.
- Click + Add statement.
- In the "Role policy" section, enter
proj/*:env/*:flag/*
in the Choose resources for this policy statement field. - Select "Allow" from the Allow or deny actions on the resource menu.
- Choose
createFlagLink
,updateFlagLink
, anddeleteFlagLink
from the Choose actions to allow or deny menu. - Click Update statement.
- Click Save role.
The custom role is now configured.
Here is an image of a custom role configured to grant access to webhooks and flag links:
You can also use the advanced role policy editor to grant permissions by adding this policy:
This means that the Jira integration will only be able to do the following:
- Create webhooks: this is needed because the Jira integration creates a webhook to push change events from LaunchDarkly to Jira
- Delete webhooks: this is used when the Jira integration is uninstalled
- Create/Update/Delete flag links: the Jira integration can update the links section of the feature flag to provide a helpful link back to the Jira issue
The Jira integration cannot perform any other actions, including toggling flags. If a member of your organization wants to toggle a flag from Jira, they have to click the URL for the flag in Jira and toggle the flag from the LaunchDarkly UI. At this point they will only be able to perform actions permitted by their role.
To learn more about custom role policies, read Creating custom roles and policies.
Next, add the custom role to the API token to grant the Jira integration additional permissions.
To add the custom role to the API token:
- Click the gear icon in the left sidenav to view Organization settings. The General settings page appears.
- Click Authorization.
- Find the API access token you want to add permissions to and select "Edit token" from its overflow menu. The "Edit" panel appears.
- In the Role menu, select "Custom."
- Check the checkbox next to the custom role you just created.
- Click Save token.
The custom role is applied to the API token.
Add the built-in Writer role to your personal access token
Expand Add the built-in Writer role to your personal access token
To add the built-in Writer role to a personal access token:
- Click the gear icon in the left sidenav to view Organization settings. The General settings page appears.
- Click Authorization.
- Find the personal access token you want to add permissions to and select "Edit token" from its overflow menu. The "Edit" panel appears.
- In the Role menu, select "Writer."
- Click Save token.
Your personal token now has the Writer role.
Configure the LaunchDarkly integration in Jira
Use your access token to configure the Jira integration for your LaunchDarkly account.
- Navigate to your Jira instance's app management page, and click the Configuration button for the LaunchDarkly app. The "Configure LaunchDarkly Integration" screen appears.
- Set your API access token.
- Select which environment the app will track for each of your LaunchDarkly projects. By default, the app will track your production environments.
If selected environments are reconfigured after issues have already been associated with flags, the existing connections display the environments they were historically connected to until the next time that flag is updated.
New flag connections display the flag configuration for the updated environment.
After you have set up the LaunchDarkly for Jira app, a "Releases" panel appears when you view issues on your Jira board.
The Jira issue view, which contains the release panel, is a per-user setting. If it is off, the release panel does not appear. To learn more, read Jira's documentation.
Now that the Jira app is configured, you can connect feature flags to Jira issues. If no flags are associated with an existing Jira issue, you can add one with a button. If you already have one or more flags associated with a Jira issue, the rollout status of each connected feature flag on each Jira issue appears.
Create a new feature flag from a Jira issue
To create a new flag with Jira issues:
- Navigate to your Jira issue's feature flag panel.
- In the "Details" section, click Add feature flag.
- Select "Create feature flag." The LaunchDarkly "Create a feature flag" panel appears with the Jira issue pre-populated.
- Finish configuring your flag and click Save flag.
When you toggle the flag on or off or make any targeting rule changes, those changes will appear in your Jira issue.
Connect an existing feature flag to a Jira issue from LaunchDarkly
If you have already created a feature flag for your Jira issue, you can add a Jira issue to your existing flag by creating a custom property for your flag.
To create a custom property:
- Navigate to the Flags list.
- Hover on the flag you wish to create a custom property for, and click the three-dot overflow menu that appears.
- Click Manage flag settings. The flag's Settings tab appears.
- Click Add custom property.
- Name the custom property
Jira issues
.
- Enter a list of Jira issue keys as the property value. You can list multiple issues if applicable.
- Click Save with comment.
View a flag's status in a Jira issue
To view a flag's status in a Jira issue:
- Navigate to your Jira issue's feature flag panel.
- In the "Details" section, click on the name of the feature flag. A dialog with a Feature flags tab appears:
Using JQL to search for Jira issues with feature flags
You can use JQL to query for Jira issues that are connected to feature flags. To learn more about JQL, read Atlassian's documentation.
Remove a feature flag from a Jira issue
To remove a flag from a Jira issue:
- Navigate to the Flags list.
- Hover on the flag you wish to remove a custom property from, and click the three-dot overflow menu that appears.
- Click Manage flag settings. The flag's Settings tab appears.
- In the "Jira Issues" section, click the X on the Jira issue custom property you want to remove.
- Click Save with comment.
Your Jira issue must exist before you associate it with your feature flag. If you accidentally added a Jira issue to your flag, delete the custom property, and try connecting your Jira issue again.