Calculate a priority score with Jira Automation
Build a weighted priority score with Jira Automation: turn select-list answers into numbers, write the math expression, and score existing work items too.
Jira doesn’t come with a priority score, but Jira Automation can calculate one for every work item: read a few fields, turn each answer into a number, weight them, and write the result to a number field you can sort by.
This guide builds a weighted score from four select lists (business value, urgency, risk reduction and effort), shows three ways to turn select-list options into numbers, scores existing work items with a scheduled rule, and covers where the approach runs out.
Design the score before the rule
Decide the formula on paper first. This example asks four questions, each a select list:
| Field | Options and points | Weight |
|---|---|---|
| Business value | Very low 1, Low 2, Medium 3, High 4, Very high 5 | × 3 |
| Urgency | Very low 1, Low 2, Medium 3, High 4, Very high 5 | × 2 |
| Risk reduction | Very low 1, Low 2, Medium 3, High 4, Very high 5 | × 1 |
| Effort | XS 1, S 2, M 3, L 5, XL 8 | Divides |
Priority score = (3 × Business value + 2 × Urgency + Risk reduction) ÷ Effort
The benefit goes on top and the cost underneath, so a valuable, urgent, cheap item scores highest. Four work items from a payments team:
| Work item | Value | Urgency | Risk | Effort | Score |
|---|---|---|---|---|---|
| Fix failed-payment retries | Very high | High | High | S | 13.5 |
| Two-factor login for admins | High | Very high | Very high | M | 9.0 |
| Bulk export to CSV | Medium | Low | Very low | S | 7.0 |
| Redesign the settings page | Medium | Very low | Low | L | 2.6 |
Keep the weights few and round. If nobody can say why value counts three times and risk once, nobody will trust the score.
Create the fields
- Create four single-choice select lists (Dropdown fields in team-managed spaces): Business value, Urgency, Risk reduction and Effort, with the options above.
- Create one number field, Priority score.
- Add all five to the work types you score.
If Jira Service Management has already added an Urgency field to your site, reuse it or pick another name. Either way, refer to the field by its ID in smart values, as in the tips below.
Turn select-list options into numbers
A select list’s answer comes through .value as text: {{issue.Urgency.value}} gives High. The math needs a number, and there are three ways to get one. The conditional logic and text function references have the details.
A lookup table
Add the Create lookup table action, name it points, and add a row for each option: Very low 1, Low 2, Medium 3, High 4 and Very high 5. Add a second table, sizes, for Effort: XS 1, S 2, M 3, L 5 and XL 8. Then look a number up with get:
{{points.get(issue.Urgency.value)}}
This is the tidiest choice for word options. The keys must match the option names exactly, so renaming an option means updating the table.
A number in the option name
Name the options with a leading number, such as 1 Very low up to 5 Very high, and take the text before the first space:
{{issue.Urgency.value.substringBefore(" ")}}
There’s no table to maintain, and scorers see the points they’re choosing.
Conditions, for two or three options
For a short list, such as High, Medium and Low, if and equals work. Put this in a Create variable action named urgencyPoints:
{{#if(equals(issue.Urgency.value, "High"))}}3{{/}}{{#if(equals(issue.Urgency.value, "Medium"))}}2{{/}}{{#if(equals(issue.Urgency.value, "Low"))}}1{{/}}
Only the matching block prints, so the variable holds 3, 2 or 1, and {{urgencyPoints}} uses it. Past three options this gets hard to read, so use a table.
Write the formula as a math expression
Wrap the arithmetic in {{#=}} and {{/}}, Jira Automation’s math expression block. With the two lookup tables:
{{#=}}ROUND((3 * {{points.get(issue.Business value.value)}} + 2 * {{points.get(issue.Urgency.value)}} + {{points.get(issue.Risk reduction.value)}}) / {{sizes.get(issue.Effort.value)}}, 1){{/}}
The smart values inside are filled in first, so for the failed-payment retries the expression becomes ROUND((3 * 5 + 2 * 4 + 4) / 2, 1), which is 13.5. ROUND keeps one decimal place.
This guide uses select lists so every answer comes from a fixed set. If your inputs are number fields instead and your Jira has the Formula field type, a formula field can do the math without a rule.
Build the rule
-
Create a rule with the Field value changed trigger, watching Business value, Urgency, Risk reduction and Effort. Watch Priority score too: by default a rule’s own edits don’t set off rules, so it can’t loop, but a hand-typed score gets recalculated.
-
Add a JQL condition, so only complete work items get a score:
"Business value" is not EMPTY AND Urgency is not EMPTY AND "Risk reduction" is not EMPTY AND Effort is not EMPTY -
Add the two Create lookup table actions.
-
Add the Edit work item action, choose Priority score, and paste in the math expression.
-
Test it on one work item: change a field and read the rule’s audit log. To see what an expression returns before it writes to a field, add a Log action that prints it.
Score existing work items with a scheduled rule
The first rule only scores a work item when someone changes one of its fields. For the rest of the backlog, build a second rule with the same actions:
-
Use the Scheduled trigger and tick Run a JQL search and execute actions for each work item in the query.
-
Point the search at complete, unscored work:
project = PAY AND statusCategory != Done AND "Priority score" is EMPTY AND "Business value" is not EMPTY AND Urgency is not EMPTY AND "Risk reduction" is not EMPTY AND Effort is not EMPTY -
Add the same lookup tables and the same Edit work item action.
-
Let it run once, check the audit log, then turn it off.
When you change a weight, every score is out of date. Take "Priority score" is EMPTY out of the search and run the rule again over every open work item. A scheduled search handles a limited number of work items per run, so for a big backlog, split it into narrower searches, such as one work type at a time.
Set Jira’s Priority from the score
To set the Priority field from the score as well, extend the first rule:
- Before the edit, add a Create variable action named
scorethat holds the math expression, and set Priority score to{{score}}. Later steps can’t use the edited field, because{{issue}}keeps the values from when the rule started. - Add an If/else block. In each part, a {{smart values}} condition checks whether
{{score}}is greater than a cut-off, and an Edit work item action sets Priority: Highest above 12, High above 8, Medium above 5, Low above 2.5, and Lowest in the final else.
The If/else block checks its conditions in order and stops at the first match, which is what a ladder of cut-offs needs. Separate branches don’t behave that way, as this Atlassian Community question about priority score logic found.
Where automation falls short
- It spends your automation allowance. Each run that writes a score counts toward the monthly allowance your plan sets, and a busy backlog runs the rule often.
- The formula is hidden inside a rule. Scorers see a number with no explanation, and only space admins and Jira admins can change the rule.
- No validation. Select lists hold the scale, but unless an admin makes the fields required, nothing makes anyone answer all four questions. Rename an option and every lookup that uses it fails.
- Blanks sort first. A work item with a blank field gets no score, and in a list sorted by
"Priority score" DESCJira puts unscored work items above the highest score. AddAND "Priority score" is not EMPTYto a filter that should list only scored work. If someone clears an answer later, the JQL condition stops the rule, so the old score stays. - No reasons. Each work item’s History tab shows every change to the answers and the score, but not the weights that produced it.
Use a custom formula in Backlog Prioritization
Backlog Prioritization for Jira works out scores from formulas of its own, so the same weighted score needs no rule:
- Metrics instead of select lists. Add a metric for each question: a number, a label, stars or a checkbox, each with its own values. Whatever the type, a metric gives the formula a number, which is the job the lookup table did.
- The formula in one place. Add a method and write the formula with
$to pick each metric and the usual math operators, as in managing methods. RICE, ICE, WSJF and Value vs Effort come ready to use if one of them fits. Changing the formula of the method you use clears the scores, so recalculate them afterward. - Scores as you go. Score work items in the grid or on the work item itself, and the score works itself out. Bulk Edit Metrics sets one value on many work items at once. Bulk edits update Score but not a number field you save the score into, so edit those work items in the grid when a dashboard relies on that field.
- A score Jira can sort by. Score is a Jira field for JQL and board filters. Save it into a number field of your own to show it on dashboards, or in Plans on Premium and Enterprise.
- History. Each work item keeps its last 50 changes made in the grid or on the work item, with who made each one, when, and the value before and after. Bulk Edit Metrics changes aren’t recorded there.
Tips for a score people trust
- Publish the formula and weights where scorers can read them, such as each field’s description.
- Test every expression with a Log action before it writes to a field.
- Use field IDs such as
customfield_10071in smart values if field names might change. - Leave the board on Rank unless you’re ready to lose drag-and-drop. Sort a saved filter by the score and rank the board to match.
- Review the weights after a few planning rounds, and rescore everything when you change them.
Questions
How do I test the rule without editing real work items?
Build it first with the Manual trigger and a Log action that prints the expression, run it on a test work item, and read the audit log. Swap in the real trigger once the numbers are right.
How do I find a field’s ID for smart values?
Open https://your-site.atlassian.net/rest/api/2/issue/PAY-1?expand=names in your browser, using one of your own work item keys. Search the response for names: that section pairs each customfield_ ID with its name.
Why does the rule sometimes write nothing?
Usually the JQL condition stopped it because a field was blank, or a lookup found no match because someone renamed an option. The rule’s audit log shows which.
Can the priority score set the board order?
Yes. Add ORDER BY "Priority score" DESC to a company-managed board’s filter, but drag-and-drop ranking then stops working on that board. Work items without a score sort to the top. Many teams sort a saved filter by the score instead and rank the board to match.
Keep reading
Try Backlog Prioritization for Jira
Score every issue the same way, with RICE, ICE, WSJF or a formula of your own, and rank the whole backlog on one grid. The score is a Jira field, so boards, filters and JQL can sort by it.