Use case
The priority of an issue should be set automatically during creation and remain unchanged afterward. This is determined based on two custom fields: Impact and Probability.
To prevent manual changes, the priority field is only shown on the view screen - it’s not available during issue creation or editing.
Prerequisite
Create two custom number fields: Impact and Probability. These fields will be used to calculate the issue’s final priority automatically during creation.
⚒️ Configuration
In the workflow editor, select the create transition and add a Update fields post function to set the desired field value.
Target issue*
Choose Current issue
Calculating the priority
The value of the priority field is in our case determined by calculating the average of two custom number fields Impact (in our case with the custom field id 13520) and Probability (in our case with the custom field id 13521) that the create set while the ticket creation
The calculation uses the avg() function to determine the mean value. The logic then checks whether this average is greater than or equal to in our case 3:
-
If the result is true, the priority is set to High (e.g., ID
"10200"). -
If the result is false, the priority is set to Low (e.g., ID
"10002").
Fields*
Select the priority field in the field list and set the value based on a parser expression.
Expression*
Set the expression editor to General mode and enter the following expression:
%{avg([{issue.cf13520},{issue.cf13521}]) >= 3 ? "10200" : "10002"}
Use the corresponding priority IDs from your priority scheme. You can find these IDs by hovering over the priority options in the scheme configuration
Run as*
Choose Jira Workflow Toolbox app user .
It’s important to run this post function as the Jira Workflow Toolbox app user, since the field is not editable as it is not added to the edit screen of the issue. The App user has the necessary rights to perform the update even when the field has not been added.