Jira
Jira is a project management tool that helps developers track and manage bugs and issues.
By integrating Jira with Cortex, you can drive improvements and coordinate issue management across teams. Through the integration, you can create Jira issues directly in Cortex based on an Initiative's action items. The integration also allows you to enhance insights into a number of key values for your entities:
Customer facing incidents
Security tickets
Ongoing projects
How to configure Jira with Cortex
It is possible to configure the integration with a Jira Cloud instance or a self-hosted Jira instance (using either basic auth or OAuth). See the tabs below for instructions on each option.
Jira Cloud
Prerequisites
Before configuring Cortex with Jira Cloud:
Create a Jira API token
To generate a token, you must have the
Browse users and groups
permissions in Jira and access to the needed Jira projects.
Configure the integration in Cortex
In Cortex, navigate to the Jira settings page:
In Cortex, click your avatar in the lower left corner, then click Settings.
Under "Integrations," click Jira.
Click Add configuration.
In the Jira integration modal, "Jira Cloud" is selected by default in the upper right corner. Configure the integration form:
Account alias: Enter an alias for your account.
Subdomain: Enter the subdomain for your Jira instance.
For example, this field would take
cortex-docs
fromhttps://cortex-docs.atlassian.net
.
Base URL: This field automatically populates
atlassian.net
.If you are using a legacy Jira Cloud instance (i.e., you access your Jira instance on
jira.com
), change the base URL from the dropdown.
Email: Enter the email address associated with the user who generated the token in Jira.
Note: The email address associated with a given Jira token must match the email address of the user associated with that token.
API token: Enter your Jira API token.
Click Save.
Once you save your configuration, you'll see it listed on the integration's settings page in Cortex. If you’ve set everything up correctly, you’ll see the option to Remove Integration in Settings.
You can also use the Test all configurations button to confirm that the configuration was successful. If your configuration is valid, you’ll see a banner that says “Configuration is valid. If you see issues, please see documentation or reach out to Cortex support.”
Configure the integration for multiple Jira accounts
The Jira integration has multi-account support. You can add a configuration for each additional by repeating the process above.
Each configuration requires an alias, which Cortex uses to correlate the designated with registrations for various entities. Registrations can also use a default configuration without a listed alias. You can edit aliases and default configurations from the Jira page in your Cortex settings. Select the edit icon next to a given configuration and toggle Set as default on. If you only have one configuration, it will automatically be set as the default.
Set a default JQL query for your Jira integration
You can set a custom JQL query for your Jira integration instances and for individual entities. This allows you to filter which Jira issues are surfaced on entity pages or in other places in Cortex where CQL is used.
The default JQL applies to jira.issues()
and jira.numOfIssues()
but not to jira.rawJql()
.
Note that if you define additional filter logic for your default JQL query when writing a Scorecard rule, you must add that logic in a filter clause. See Adding filter logic to the default JQL query in a Scorecard for more information.
Set default JQL query at a tenant level
From the Jira settings page in Cortex, you can set a custom JQL query for your Jira integration.
When Cortex queries for Jira issues, the statusCategory
is directly grabbed from the API response.
The default query — statusCategory in ("To Do", "In Progress")
— will filter your Jira tickets to display only those with To Do
and In Progress
statuses, excluding closed tickets. The indeterminate
status category will map to In Progress
according to the API. Cortex does not use the status
field for mapping these categories.
Entering a custom JQL query on the Jira integration settings page allows you to override the default for all entities in your workspace. To map issues with a custom status, you can write a custom JQL query that uses status
instead of statusCategory
.
Fallback logic for default JQL
It is possible to set custom JQL at both the entity and tenant level, but note the fallback logic:
If any JQL is passed into a query, Cortex uses that.
If not, Cortex uses entity-level default JQL.
If not, Cortex uses tenant-wide default JQL.
If none, then no JQL is used for filtering.
Adding filter logic to the default JQL query in a Scorecard
The CQL statement will use the default JQL setting in a Scorecard rule only if you do not define additional filter logic. Any filter logic applied to the statement will override the default JQL query.
To work around this: If you need to include additional filter logic on your query in a Scorecard, you can move the filter logic to the filter clause.
For example, if your default JQL query is set to "project = project_a"
, then you can add jira.issues()
to a Scorecard rule to automatically surface only the issues relating to Project A. However, you cannot use jira.issues(some_other_filter_logic)
in a Scorecard; Cortex will not append your default JQL to the additional filter logic.
In this example, the workaround would be to add a filter clause:
jira.issues().filter(some_other_filter_logic)
.
How to connect Cortex entities to Jira
Discovery
By default, Cortex will tie Jira tickets to entities by searching for any tickets where the label
, component
, or project
field for the issue includes the Cortex entity tag. For example, if your entity tag is “my-entity,” then the corresponding tickets in Jira should have “my-entity” as a label, component, or project.
If your Jira label/component/project doesn't cleanly match the Cortex entity tag, you can override this in the Cortex entity descriptor.
Without an override, a ticket's label, component, or project must exactly match the entity tag in the descriptor.
Editing the entity descriptor
If you need to override automatic discovery, you can define one of the following x-cortex-issues
blocks in your Cortex entity descriptor.
Note: For all of the following, alias
is optional, and the default Jira configuration will be used if not provided. You can use Jira labels
, components
, or projects
to match entities.
Each of these blocks has the same field definitions.
name
Label name in Jira
✓
alias
Alias for the configuration in Cortex (only needed if you have opted into multi-account support)
By default, Cortex will surface outstanding issues per entity in the catalog with a default JQL query: statusCategory in ("To Do", "In Progress")
. If you'd like to override this, you can provide a new default query with:
Identity mappings
Cortex maps Jira accounts to team members defined in the team catalog, so you do not need to define Jira users in a team member's YAML file.
You can confirm that users' Jira accounts are connected from the Jira user mappings section in Settings.
Expected results
Entity pages
Once the integration is established, you'll be able to pull in data about the issues in any linked Jira instances for a given entity:
Number of issues: Unresolved issues associated with an entity that have the JQL status "in progress" or "to do"
Number of issues from JQL query: Issues associated with an entity that match an arbitrary JQL query
Cortex will tie Jira tickets directly to entities within the catalog. Click Issue tracking in the entity's sidebar to see associated Jira tickets.
From this tab you can find a list of all issues with a label that matches the entity tag.
Key: The issue key (or "ticket number") for a Jira issue.
Issue summary: Title of the Jira issue and the user designated as the issue reporter.
Assignee: User designated as the issue assignee.
Priority: The issue's priority level in Jira - Lowest, Low, Medium, High, Highest. This will display with the icon that corresponds to the priority level in your Jira instance.
Created: Date the issue was created.
Due: Due date for the issue, if applicable.
This list will also be available from a team's homepage when the team's entity tag matches a label
, component
, or project
in Jira.
Initiatives
Initiatives allow you to set deadlines for specific rules or a set of rules in a given Scorecard and send notifications to users about upcoming due dates.
From the Issues tab of an Initiative, you can automatically create a Jira ticket from a failing rule.
Read about creating Jira issues from Initiatives in the documentation: Creating issues based on initiatives.
Dev homepage
The Jira integration enables Cortex to pull information about issues into the dev homepage. You can find open issues assigned to you under the Issues tab. The issues that display will depend both on the Jira instances you've connected and the JQL query defined in Settings.
Issues are refreshed every 5 minutes. You can use the Refresh Jira issues button to manually refresh issues at any point.
Scorecards and CQL
With the Jira integration, you can create Scorecard rules and write CQL queries based on Jira issues.
See more examples in the CQL Explorer in Cortex.
Background sync
The developer homepage runs a background job every 5 minutes to refresh the Issues tab.
FAQs and troubleshooting
I've added a Jira integration, but I'm not sure what JQL is being generated to query Jira.
When running Scorecard rules, Cortex appends AND (component = entity-tag OR labels = entity-tag OR project = entity-tag)
to the JQL you defined, where entity-tag
is the entity tag.
My Scorecard rules are failing, even though there are tickets in my Jira instance.
Make sure that the ticket has a label, component, or project that matches exactly with the entity tag or the list defined in your entity descriptor.
I received "Configuration error: Integration error for Jira: Unexpected HTTP response 0".
When using Jira Cloud, you'll need to create a Jira API token and add it on in Jira Settings in Cortex. The email address in Settings must be the same as the user that the token is associated with. Cortex also expects only the subdomain of your Jira instance, not the entire URL.
I received "Configuration error: Jira: Unexpected HTTP response 403: Forbidden".
Make sure that the entity name in Cortex matches the label, component, or project name in Jira.
Make sure the subdomain and base URL correspond with the Jira instance you're trying to connect.
Verify that the Jira token you added is still valid. You can run the following curl command to confirm:
Still need help?
The following options are available to get assistance from the Cortex Customer Engineering team:
Email: help@cortex.io, or open a support ticket in the in app Resource Center
Chat: Available in the Resource Center
Slack: Users with a connected Slack channel will have a workflow added to their account. From here, you can either @CortexTechnicalSupport or add a
:ticket:
reaction to a question in Slack, and the team will respond directly.
Don’t have a Slack channel? Talk with your Customer Success Manager.
Last updated