Compare 5 field contents and write the highest value in a field

Claudia Hossmann July 7, 2024

I would like to compare 5 fields (custom fields - select list (single choice)) in an issue and write the highest value or these 5 fields (only values 1-6 can be selected) in another custom field (also a single-choice field).

Can this be done with Jira Cloud Automation and how?

1 answer

2 votes
Tim Kopperud
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2024

Hi @Claudia Hossmann, you might use the smart value math function MAX() for this. 

The principle is like this: 

{{#=}}MAX(1, 2, 3, 4, 5, 6){{/}}

Adding this to the automation e.g. like this:

image.png

will return 6 as seen here

image.png

So, you can the use MAX(e,1,e2, ...) mentoined at the end of this page Automation smart values - math expressions | Cloud automation Cloud | Atlassian Support

Replace 1,2,3, etc with your custom fields, like this example:

{{#=}}MAX(
{{My customfield A}},
{{My customfield B}},
{{My customfield C}},
{{My customfield D}},
{{My customfield E}})
{{/}}

Edit this code to match your field names, and paste it into an Edit issues fields action as shown here, where I used the summary field (replace summary with your "result field"):

image.png

TimK

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events