The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Sergey Shmarkatyuk
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 Champions.
February 18, 2013

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
JamieA
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 Champions.
February 18, 2013

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.

0 votes
Christian Czaia [Decadis AG]
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 Champions.
February 18, 2013

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"...

TAGS
AUG Leaders

Atlassian Community Events