Configuring Jira Automation to recalculate risk values

Overview

The Risk Formulas Editor is a powerful tool that allows administrators to create formulas that calculate the values of a risk issue depending on other values. For example, we might have a formula that calculates the Risk Severity of an issue as its Risk Impact multiplied by its Risk Probability. Whenever either of the latter two fields are changed, the value of the first field is automatically recalculated according to the formula.

But we may need to calculate risk values in a more complicated way, which takes account of specific conditions. For example, we may want the Risk Probability to be halved when the issue transitions to resolved status. To achieve this result, we can turn to Jira Automation. We describe below how to create an automation rule that updates the Risk Probability field of a risk issue so that its value is halved when the issue transitions to Done.

Administration

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 > Automation rules (or Global Automation on Jira Cloud)

  • For a project-specific rule, go to Project Settings > Automation.

Follow the steps below to set up an automation rule. (The screenshots are from Jira Data Center, but the same steps apply to Jira Cloud with a different look and feel.)

Step

Action

Explanation

Step

Action

Explanation

Create a new rule

Select the Create rule button.

 

Create a trigger for the rule

Select the trigger Issue transitioned in section Issue Triggers and select Done as the target status.

image-20240322-121835.png

The rule is triggered when the issue's workflow status is changed to Done.

Add conditions

Select an if condition, e.g. Issue Fields conditions. Here we require that the Issue Type is Risk.

image-20240322-122204.png

Different conditions can be specified to enforce the desired behavior. If the rule is created in a specific project, then it is automatically limited to that project. If the rule is global, then there should be a condition that specifies the projects for which it is valid, unless it is actually intended to apply to all projects.

In the example, the conditions check the following:

  • The issue is of type Risk.

  • The Risk Probability field is not empty.

If the Risk Probability field lacked a value, the following calculation would fail, so it’s better to exclude that case.

Apply change

Select the action Edit issue

 

Define the formula to be used to update the issue’s Risk Probability field:

{{#=}}0.5*{{issue.CustomField_10605}}{{/}}

The formula uses the internal ID of the custom field Risk Probability, which is 10605 in this Jira instance.

The mysterious expression{{#=}}instructs Jira to execute the calculation and update the given field with the result.

See the following references to learn about the math expressions supported by Jira:

Enable the rule

Provide a name for the rule and then enable it by selecting Turn it on.

Â