Automate Review Cockpit: Modify approved issuses

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:

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

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.

image-20250528-110639.png

 

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

image-20250528-110744.png

 

Web request URL: Use https://<SERVER LOCATION>.r4j-cloud.easesolutions.com/rest/internal/1/project/{{issue.project.id}}/review/scope/{{issue.key}.

  • This is currently an internal REST API call, details of the public calls can be found at easeRequirements Cloud REST API Reference.

  • With data residency feature in place, your <SERVER LOCATION> must be specified. Check with the Jira system admin for the correct location.

HTTP method: GET

Web request body: Empty

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:

  • key: X-Atlassian-Base-Url

  • value: Your Jira cloud server URL (e.g. https://mycompany.atlassian.net/)

  • key: Authorization

  • value: your basic authentication hash key, e.g. Basic ZnJlZDpmcmVk - see Jira Authentication.

Example of headers:

image-20240311-141217.png

Log Web Request Result

Select the action Add value to the audit log

image-20250528-111352.png

 

For debugging purpose you can add a log message to the audit log of the automation, showing the response from above request:

Log message: Result: {{webResponse.body}}

Iterate over all issues in the scope

Select FOR EACH: Add a branch > Advanced branching

image-20250528-112341.png

 

 

Use the web response body:

Smart Value: {{webResponse.body}}

Variable name: reviewedIssueKey

Log processed issue

Select the action Add value to the audit log

image-20250528-112355.png

 

For debugging purpose:

Log message: Processing issue: {{reviewedIssueKey}}

Request issues in scope

Select the action Send web request

image-20250528-113042.png

 

Web request URL: Use https://<SERVER LOCATION>.r4j-cloud.easesolutions.com/rest/internal/1/project/{{issue.project.id}}/review/{{issue.key}}/score?issueId={{reviewedIssueKey}}&mode=moderator.

  • This is currently an internal REST API call.

For the parameters see above request.

Response if authenticated user is member of the moderators:

  • {{webResponse.body.totalPending}}: Number of reviewer answers pending

  • {{webResponse.body.totalAccepted}}: Number of reviewers accepted

  • {{webResponse.body.totalRejected}}: Number of reviewers rejected

Add conditions

Select an if condition Compare tow values

image-20250528-151013.png

 

Check hat all reviewers have given their answer.

  • First value: {{webResponse.body.totalPending}}

  • Condition: equals

  • Second value: 0

 

  • First value: {{webResponse.body.totalRejected}}

  • Condition: equals

  • Second value: 0

 

Action

Define any action when the conditions match, e.g. state the issues state or Add value to the audit log

image-20250528-151114.png

 

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.