Using conditional execution with customer single-select custom field

Simon Tilbury November 9, 2021

I'm configuring a "create issue" post function with a "conditional execution" added so that the Create Issue should only run if/when custom field (a Single Select List) is set to "XYZ"

I've tried 

{{ issue.fields['Products Impacted'].value == "XYZ" }} but this is always returning false no matter whether null, set to XYZ or set to something else 

Thanks for the help!

1 answer

1 accepted

0 votes
Answer accepted
Avinash Bhagawati {Appfire}
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 9, 2021

Hi @Simon Tilbury ,

Can you please check below points on this.

  • Test the condition against an existing issue for all the scenarios.
    test01.png

  • If you still get false for all the scenarios, navigate to Settings > Issues > Custom Fields > Search for 'Products Impacted' >  Click on .. against it and click 'contexts & default value > check for XYZ value > Edit it and check if you have any spaces before or after XYZ. If any space exists please remove the spaces & save. Try the scenario.
    Screenshot 2021-11-09 at 11.10.01 PM.png
  • Alternatively, you can make use of below code. In below code, instead XYZ as value you can give the option id of the selected value.

    {{ issue.fields[
    'Products Impacted'].id == 10001}}

  • Please note that you will be able to see option id once you click on Edit against select option. Please refer below screenshot.
    Screenshot 2021-11-09 at 11.16.00 PM.png

 

Thanks,
Avinash

Simon Tilbury November 10, 2021

Brilliant! 

I had originally used

issue.customfield_17082.value == "XYZ" 

I then changed to (but didnt work)

issue.customfield_17082.id == 16942

I then changed to and this worked

issue.fields['Workstream'].id == 16942

 

Many thanks for the helpful/clear explanation. Much much appreciated! :) 

Avinash Bhagawati {Appfire}
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 10, 2021

Thanks @Simon Tilbury , Glad to know that configurations are working as expected.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events