How can I add groovy custom field validator on the workflow transition using field id?

I have two custom fields with the same name, but having different custom field types. One is number field, another is select list.

I cannot reference second one in my workflow transition validator. If I use condition

cfValues['Week number'] == ''

, it references number field instead of select list field

If I use condition with custom field id

cfValues[11270] == ''

or

cfValues['customfield_11270'] == ''

, it does not work either

How can I add groovy custom field validator on the workflow transition using field id?

2 answers

This widget could not be displayed.

You won't be able to use cfvalues, you have to use issue.getCustomFieldValue(CustomField) etc.

Personally, I don't think it's great practice to have two CFs with the same name associated with the same issue. Makes searches hard for one thing.

This widget could not be displayed.

Just curious, can you address the number field by its ID? You're checking for an empty value in a select list...usually the select lists do have option values like "-1" for "none"...

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

124 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you