Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA Structure formula

Abhinav Singhal September 11, 2025

we have 8 priority-style labels (A-1 = highest, H-8 = lowest) or (H-8, G-7, F-6, E-5, D-4, C-3, B-2, A-1 )tagged with JIRA issues 
If an issue has multiple labels, we want Structure formula to compare them and display the **highest-priority one (A-1 > … > H-8)*.

  • If an issue has ["C-3", "F-6"] → formula returns 3 (C-3).

  • If it has ["B-2", "E-5", "H-8"] → formula returns 2 (B-2).

I am loading all issues in JIRA structure and created below formula 

WITH priorityOrder = {
"A-1": 1,
"B-2": 2,
"C-3": 3,
"D-4": 4,
"E-5": 5,
"F-6": 6,
"G-7": 7,
"H-8": 8
};

WITH best = MIN(FOR l IN LABELS: priorityOrder[l]);
FIRST(FOR l IN LABELS: IF priorityOrder[l] = best: l)

it is not working do we have any solution for the same

 

 

2 answers

0 votes
Abhinav Singhal September 13, 2025

getting error pls check

error.png

0 votes
Christos Markoulatos
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 11, 2025

Hey @Abhinav Singhal, I believe you are close! The main issue is WITH scoping: in Structure’s Expr language, a WITH … : <expression> only defines the variable for the expression that follows the colon, so you can’t define priorityOrder on one line and then use it in a completely separate expression. You need to nest the WITH blocks (or keep everything inside the first WITH). Also, it’s a good idea to guard against labels that don’t match your A‑1…H‑8 list (or issues with no labels) using DEFAULT(...) / IFERR(...).

Check the links below

Structure's Formula Language (Expr)

Advanced Expr

Conditional Functions

Abhinav Singhal September 14, 2025

error.png

 

getting the above error, pls help

Suggest an answer

Log in or Sign up to answer