Jira for Workflows

Your Dynatrace environment can integrate with a Jira Cloud or Server instance using Jira for Workflows 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 Jira for Workflows from Dynatrace Hub.

  1. In Dynatrace Hub Hub, select Jira for Workflows.
  2. 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.

Step 1 Allow Jira for outbound connections

  1. Go to Settings and select Connections > Outbound and inbound > Limit outbound connections. This opens the Settings Classic page.
  2. 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.
  3. Select Save changes.

This way, you can granularly control the web services to which your Dynatrace environment can connect.

Step 2 optional Configure EdgeConnect

If you are connecting to a self-hosted Jira instance, you might require EdgeConnect to establish a connection behind your firewall.

  1. Open the EdgeConnect app and select New EdgeConnect.
  2. Enter the name of the connection and the destination URL.
  3. Follow the described steps to roll out EdgeConnect in your environment.

Step 3 Grant permissions to Workflows

Some permissions are required by Workflows to run actions on your behalf.

To fine-tune permissions granted to Workflows

  1. Go to Workflows and select Settings > Authorization settings.
  2. 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.

Step 4 Authorize connection to Jira

  1. 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.

  2. Return to Dynatrace, go to Settings and select Connections > Connectors > Jira.
  3. Select Add 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.
  4. 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

  1. Go to Workflows Workflows and select Add to create a new workflow.

  2. In the side panel, select the trigger best suited to your needs.

  3. On the trigger node, select Add to browse available actions.

  4. In the side panel, search the actions for Jira for Workflows and select Create Issue.

  5. Select a preconfigured Jira connection.

  6. Select a Jira project.

  7. Select an issue type.

  8. 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.

  9. Enter summary text.

  10. 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.

  11. 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

  1. Go to Workflows Workflows and select Add to create a new workflow.

  2. In the side panel, select the trigger best suited to your needs.

  3. On the trigger node, select Add to browse available actions.

  4. In the side panel, search the actions for Jira for Workflows and select Transition issue.

  5. Set Connection to a preconfigured Jira connection.

  6. Set Issue Key to the exact issue key (for example, XYZ-1234).

  7. Set Transition Status to the status that the issue should have after this transition. You can use workflow expressions as input here.

  8. In Enter a comment (optional), write the text that you want to add to the issue during the transition operation.

  9. If the destination status requires extra Fields to fulfill the transition, enter them in Key/Value pairs.

  10. 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

  11. Select Save.

  12. 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 passed
  • Failed (with more information) if the transition failed

Comment on issue

  1. Go to Workflows Workflows and select Add to create a new workflow.
  2. In the side panel, select the trigger best suited to your needs.
  3. On the trigger node, select Add to browse available actions.
  4. In the side panel, search the actions for Jira for Workflows and select Comment on issue.
  5. Select a preconfigured Jira connection.
  6. Provide an issue key (for example, XYZ-1234). It is also possible to use workflow expressions as input.
  7. Provide the comment. Format your message using Jira Text Formatting Notation. You can also use workflow expressions as input.
  8. 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

  1. Go to Workflows Workflows and select Add to create a new workflow.
  2. In the side panel, select the trigger best suited to your needs.
  3. On the trigger node, select Add to browse available actions.
  4. In the side panel, search the actions for Jira for Workflows and select Change assignee.
  5. Select a preconfigured Jira connection.
  6. Provide an issue key (for example, XYZ-1234). It is also possible to use workflow expressions as input.
  7. Select an assignee from the list and optionally search for the user by name.
  8. To test your workflow, select Run.
  1. Go to Workflows Workflows and select Add to create a new workflow.
  2. In the side panel, select the trigger best suited to your needs.
  3. On the trigger node, select Add to browse available actions.
  4. In the side panel, search the actions for Jira for Workflows and select JQL Search.
  5. Select a preconfigured Jira connection.
  6. Set JQL to a valid query to search (for example, PROJECT = CA AND assignee = null).
  7. 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.
  8. 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.
  9. Set Maximum number of results to the maximum number of results you want the search to return (for example, 10).
  10. To test your workflow, select Run.

Action result

  • The Detail tab shows the State of the operation:

    • Success if the JQL search operation passed
    • Failed (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.