Set priority based on cascading select list

Kevin Lynch April 4, 2018

I've got a Jira Cloud instance with Jira Misc Workflow Extensions. I'm trying to set the priority of an issue during the tickets creation that is based on a cascading select list and their values

First list (Impact): Entire Org, Location/Dept, Single User, Workgroup/Team

Child lists are all identical: Customer Facing, Inconvenience, Service Request, Work Impacted, Work, Work Stopped.

Based on the selection of the first value and then the child value, it will determine a specific priority.

Two examples:
parent selection (Entire Org), child selection (Customer Facing) = priority (Highest)
parent selection (Single User), child selection (Work Impacted) = priority (Medium)

Taking example one. In my Post Functions in my Transition: Create Issue, I have selected to use the 'Set field value (JMWE add-on)'. I have set the Field to Priority and Value is Highest. I have checkmarked the 'Run this post-function only if a condition is verified' and put the Condition as 'issue.fields["Impact Urgency"].value == "Entire Org" && issue.fields["Impact Urgency"].child.value == "Customer Facing"'.

When I create an issue, it does change the Priority to Highest. The issue comes when I add a second Set field value (JMWE add-on) setting to the Post Function. So that there are two of them.

Taking example two. In my Post Functions in my Transition: Create Issue, I have selected to use the 'Set field value (JMWE add-on)'. I have set the Field to Priority and Value is Medium. I have checkmarked the 'Run this post-function only if a condition is verified' and put the Condition as 'issue.fields["Impact Urgency"].value == "Single User" && issue.fields["Impact Urgency"].child.value == "Work Impacted"'.

When I create an issue, it changes the Priority to Highest and not Medium. This seems to indicate that the conditional statement is identified as true for both and because the ordering of the JMWE post functions, that the second post function is overwriting the first.

What I need this to do is only enact the priority change if the conditional values are exact matches, not that any random value is present. I actually made condition test == value a random string (not part of my cascading values) and it still found the condition as true.

 

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Kevin Lynch April 5, 2018

This was a bit of a learning experience. The issue was simple to resolve. issue.fields["Impact Urgency"].value == "Single User" && issue.fields["Impact Urgency"].child.value == "Work Impacted" needs to have {{ }} placed around it and change the && to lowercase and

{{issue.fields["Impact Urgency"].value == "Single User" and issue.fields["Impact Urgency"].child.value == "Work Impacted"}}

When the value is tested now, it will test as False or True based on the values in the field during creation. 

Yogesh Mude
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.
December 21, 2018

HI @Kevin Lynch

Could you please add the little bit more code as we are also looking for the same functionality...

We have two cascade custom fields ..Organization and Category...so whenever user will select Organization as [XYZ - ABC] then Category should show [MNO - DEF]..like

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events