Jira for Workflows
Your Dynatrace environment can integrate with a Jira Cloud or Server instance using Jira for Workflows . With this integration, you can automate creating, commenting, and assigning Jira issues on the events and schedules defined for your workflows.
Set up Jira integration
To use Jira workflow actions, you first need to install Jira for Workflows from Dynatrace Hub.
- In Dynatrace Hub , select Jira for Workflows.
- Select Install.
To install Jira for Workflows, you need the
app-engine:apps:install
permission.
After you install Jira for Workflows, you need to perform some initial steps to set up the connection between Jira and your Dynatrace environment.
Allow Jira for outbound connections
Configure EdgeConnect
Grant permissions to Workflows
Authorize connection to Jira
Allow Jira for outbound connections
- Go to Settings and select Connections > Outbound and inbound > Limit outbound connections. This opens the Settings Classic page.
- Select Add item and add the domain of your publicly accessible Jira instance. For example,
*.atlassian.net
can be added if the Jira for Workflows actions should connect to a Jira Cloud instance. - Select Save changes.
This way, you can granularly control the web services to which your Dynatrace environment can connect.
Configure EdgeConnect
If you are connecting to a self-hosted Jira instance, you might require EdgeConnect to establish a connection behind your firewall.
- Open the EdgeConnect app and select New EdgeConnect.
- Enter the name of the connection and the destination URL.
- Follow the described steps to roll out EdgeConnect in your environment.
Grant permissions to Workflows
Some permissions are required by Workflows to run actions on your behalf.
To fine-tune permissions granted to Workflows
- Go to Workflows and select Settings > Authorization settings.
- Select the following permissions besides the general Workflows permission.
- Permissions needed for workflow actions:
app-settings:objects:read
state:app-states:read
state:app-states:write
state:app-states:delete
For more on general Workflows user permissions, see User permissions for workflows.
For more on general Workflows user permissions, see User permissions for workflows.
Authorize connection to Jira
- Get credentials for the Jira instance. The following authentication methods are supported:
-
Basic Authentication
We don't recommend using the basic authentication scheme, but it may still be required to authenticate older Jira Server versions that don't support the personal access token.
-
Personal Access Token (PAT) recommended
This is the recommended method to use for Jira Server. To learn which versions of Jira Server support personal access tokens and how you can create them, see Using personal access tokens in the Atlassian Jira documentation.
-
Jira API Token (Jira Cloud)
When connecting to a Jira Cloud instance, use the Jira API tokens.
-
- Return to Dynatrace, go to Settings and select Connections > Connectors > Jira.
- Select Connection and provide a name, the URL of the Jira instance, and—depending on the type of the credentials—either a username/password or simply a token.
- Select Create.
Additional notes
-
To improve traceability and audibility, use a Jira service user to access your Jira instance.
-
To add connection settings, you need the following permissions:
ALLOW settings:objects:read, settings:objects:write, settings:schemas:read WHERE settings:schemaId = "app:dynatrace.jira:connection"For details, see Permissions and access.
-
Be aware that connections are shared and can be used by all users with
app-settings
read permissions. This is by design, as workflows enable a simplified ticket lifecycle across projects and entities.
Create Jira issues with workflows
-
Go to Workflows and select to create a new workflow.
-
In the side panel, select the trigger best suited to your needs.
-
On the trigger node, select to browse available actions.
-
In the side panel, search the actions for Jira for Workflows and select Create Issue.
-
Select a preconfigured Jira connection.
-
Select a Jira project.
-
Select an issue type.
-
Optionally, select values for fields such as priority, assignee, reporter, labels, and components.
Not all fields support workflow expressions and some fields depend on others. For example, the priority cannot be set if the issue type is unknown.
-
Enter summary text.
-
Enter a description for the Jira issue.
Format your message using Jira Text Formatting Notation. You can also use workflow expressions as input for the description.
-
To test your workflow, select Run.
Action result
The Create Issue action provides the following result:
Property
Description
id
The numeric ID of the newly created Jira issue (for example, 1234567
).
key
The Jira issue key of the newly created Jira issue (for example, XYZ-1234
).
url
A URL that links to the newly created Jira issue (for example, https://<your-jira-instance>.atlassian.net/browse/XYZ-1234
).
This result can be used as inputs for other workflow actions via workflow expressions.
Transition issue
-
Go to Workflows and select to create a new workflow.
-
In the side panel, select the trigger best suited to your needs.
-
On the trigger node, select to browse available actions.
-
In the side panel, search the actions for Jira for Workflows and select Transition issue.
-
Set Connection to a preconfigured Jira connection.
-
Set Issue Key to the exact issue key (for example,
XYZ-1234
). -
Set Transition Status to the status that the issue should have after this transition. You can use workflow expressions as input here.
-
In Enter a comment (optional), write the text that you want to add to the issue during the transition operation.
-
If the destination status requires extra Fields to fulfill the transition, enter them in Key/Value pairs.
-
Select Add Field.
The syntax for custom field values depends on the custom field type. For more information, see Jira documentation for Setting custom field data for other field types.
Examples:
Key
Value
FreeTextField
"customfield_10004": "Free text goes here. Type away!"
GroupPicker
"customfield_10005": { "name": "jira-developers" }
MultiSelect
"customfield_10008": [ {"value": "red" }, {"value": "blue" }, {"value": "green" }]
NumberField
"customfield_10010": 42.07
-
Select Save.
-
To test your workflow, select Run.
Action result
The Transition issue action currently provides no results, but the Input tab shows all IDs associated with the transition and the logs provide some feedback.
The Detail tab shows the State of the operation:
Success
if the transition operation passedFailed
(with more information) if the transition failed
Comment on issue
- Go to Workflows and select to create a new workflow.
- In the side panel, select the trigger best suited to your needs.
- On the trigger node, select to browse available actions.
- In the side panel, search the actions for Jira for Workflows and select Comment on issue.
- Select a preconfigured Jira connection.
- Provide an issue key (for example,
XYZ-1234
). It is also possible to use workflow expressions as input. - Provide the comment. Format your message using Jira Text Formatting Notation. You can also use workflow expressions as input.
- To test your workflow, select Run.
Action result
The Comment on issue action provides the following result:
Property
Description
id
The numeric ID of the comment (for example, 123456
).
This result can be used as inputs for other Workflow actions via workflow expressions.
Change assignee
- Go to Workflows and select to create a new workflow.
- In the side panel, select the trigger best suited to your needs.
- On the trigger node, select to browse available actions.
- In the side panel, search the actions for Jira for Workflows and select Change assignee.
- Select a preconfigured Jira connection.
- Provide an issue key (for example,
XYZ-1234
). It is also possible to use workflow expressions as input. - Select an assignee from the list and optionally search for the user by name.
- To test your workflow, select Run.
JQL Search
- Go to Workflows and select to create a new workflow.
- In the side panel, select the trigger best suited to your needs.
- On the trigger node, select to browse available actions.
- In the side panel, search the actions for Jira for Workflows and select JQL Search.
- Select a preconfigured Jira connection.
- Set JQL to a valid query to search (for example,
PROJECT = CA AND assignee = null
). - Set Fields to a comma-separated list of fields returned from the search (for example,
key,summary,created
). See the onscreen instructions for additional options. - Set Expand to a comma-separated list of entities that you want to be expanded (for example,
names, renderedFields
). You can optionally leave this empty. - Set Maximum number of results to the maximum number of results you want the search to return (for example,
10
). - To test your workflow, select Run.
Action result
-
The Detail tab shows the State of the operation:
Success
if the JQL search operation passedFailed
(with more information) if the search failed
-
The Result tab lists all the records from the search (if the search was successful).
Troubleshooting
The following are solutions to problems some people had with Jira for Workflows actions.