cf values in scriptrunner for multiple custom fields is not possible to set

Stefano Colagiacomo
Contributor
November 15, 2023

Hello I have this problem:

 

I m trying to use this simple script


String a = cfValues['custom_field']
String b = cfValues['custom_field']
a.length() == b.length()
but the problem is that cf values in string b give me an error becuse in our instance we  created 2 custom fields with the same name so I received this error:

"Could not look up the type for this custom field, so this code can't be type-checked. Possibly the field doesn't exist, or multiple exist for this name"
I know that a work around could be change the name of the custom field but this is not possible for other reason.
SO I would like to know if someone can give me a solution where in string b I can indicate just one (the right) of two custom fields that we have in our instance.
I already tried using the id in this format "customfield_10902" or "10902" but didn't works

1 answer

0 votes
Marko Blagus
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.
November 15, 2023

Hello @Stefano Colagiacomo

 

Did you try to retrieve custom field's value by using its id like it's explained here?

 

Best regards,

Marko Blagus

Suggest an answer

Log in or Sign up to answer