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