Automate Review Cockpit: Modify approved issuses
Overview
Within the Review Cockpit the reviewers would approve or reject their issues. After the review process someone wants to modify all considered issues. E.g. it could be necessary to change the workflow state for all accepted issues to a reviewed state. The described automation iterates over the issues within a review process and uses easeRequirements REST APIs to retrieve current verdicts.
The used REST API need the authentication of a dedicated user. This user must be added to the moderator list of the review to retrieve the necessary details.
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 Manual triggered in section Issue Triggers.
| The rule can be triggered by a user on the review issue itself. Restrict it certain user groups/roles and work item type (e.g. Review). Prompt the user with e.g. a checkbox to confirm a text like To start the automation manually, confirm that you´ve added "<name>" user into the moderator field. Otherwise the execution will fail. |
Request issues in scope | Select the action Send web request
| Web request URL: Use
HTTP method: Web request body: Delay: Select Delay execution of subsequent rule actions until we've received a response for this web request Headers: Add the following two key/value pairs:
Example of headers: |
Log Web Request Result | Select the action Add value to the audit log
| For debugging purpose you can add a log message to the audit log of the automation, showing the response from above request: Log message: |
Iterate over all issues in the scope | Select FOR EACH: Add a branch > Advanced branching
| Use the web response body: Smart Value: Variable name: |
Log processed issue | Select the action Add value to the audit log
| For debugging purpose: Log message: |
Request issues in scope | Select the action Send web request
| Web request URL: Use
For the parameters see above request. Response if authenticated user is member of the moderators:
|
Add conditions | Select an if condition Compare tow values
| Check hat all reviewers have given their answer.
|
Action | Define any action when the conditions match, e.g. state the issues state or Add value to the audit log |
|
Enable the rule | Provide a name for the rule and then enable it by selecting Turn it on. | Test the execution on an existing review and check the automation audit log. |