CLOUD | DATA CENTER AND SERVER
Configuring Jira Automation to add issues to tree
Overview
A problem arises when users create issues outside of the easeRequirements project tree. Such issues are not visible in the tree and tend to be overlooked. The app does not yet provide a built-in feature to solve this problem, but in this page we explain how to create Jira Automation rules to recognize such issues and automatically add them to a specific place in a project tree, for example, in a folder dedicated to new issues.
Jira Authentication
The automation solution uses a REST API web request relying on basic authentication. The required base64 encoded authentication string must be defined in advance for a specific user account. While a real user account can be used for this purpose (e.g. the account of a project admin or the Jira system admin), we recommend that a separate, dedicated account be created, due to the fact that Jira does not limit the visibility of the user’s authentication string in automation rules, thus allowing for the possibility of misuse. The dedicated account should be:
Enabled only for specific projects.
Restricted by the easeRequirements tree permission so that it can only update the tree structure.
To create the necessary authentication string, the instructions provided by Atlassian should be followed. See the second option at REST API Authentication and Supply basic auth headers.
Creating the Automation Rule
To configure an automation rule, you need to be a Global or Project administrator.
For a global rule, go to Jira Settings > System > Global Automation.
For a project-specific rule, go to Project Settings > Automation.
Follow the steps below to set up an automation rule.
Step | Action | Explanation |
---|---|---|
Create a new rule | Select the Create rule button. |
|
Create a trigger for the rule | Select the trigger Issue created in section Issue Triggers.
| The rule is triggered when a new issue is created. |
Add conditions | Select an if condition, e.g. Issue matches JQL
| Different conditions can be specified to enforce certain behavior. If the rule is created in a specific project, then it is automatically limited to that project. If the rule is global, then the condition should specify the projects for which it is valid unless it is actually intended to apply to all projects. There is no need to add a condition that the issue is not already in the project tree. When an issue is created in a easeRequirements project tree to begin with, the execution of the rule is triggered, but fails immediately, without changing the location of the issue. |
Add variables | Select the action Create variable
| Specify two smart variables:
Example of how to specify the variable targetProjectKey: |
Add REST API web request | Select the action Send web request
| Web request URL: Use
HTTP method: Web request body: Custom data value: {
"id": null,
"jiraIssueId": null,
"jiraIssueKey": "{{targetFolderKey}}",
"items": [
{
"jiraIssueId": null,
"jiraIssueKey": "{{issue.key}}",
"position": 1
}
]
} Note how the following values are set in the data value:
Headers: Add the following two key/value pairs:
Example of headers: |
Optional: Validate the web request |
| To validate the web request:
The returned error code should be 200 for successful execution. For debugging check out the returned payload. Note that the rule is not actually executed. |
Enable the rule | Provide a name for the rule and then enable it by selecting Turn it on. |
|