How to resolve "could not look up the type for this custom field"

I'm using JIRA ScriptRunner plugin and I'm trying to run a condition check for one of the custom field "Region" that has multiple types configured. Like Single Select, Multi Select, Checkbox.

I have tried the following and none of them work yet.

BTW the current type that I'm looking for is "Single Select" type.

cfValues['Region']?.value == 'GLBL'

cfValues['customfield_10000']?.value == 'GLBL'

cfValues['Region']*.value.contains("GLBL")

I get a warning that "Could not look up the type for this custom field, so we can't check this code. Possibly the field doesn't exist, or multiple exist for this name " 

Thanks

1 answer

1 accepted

1 vote

It's just a type-checking warning, you can ignore it. There is not enough information for it to work out if the code is correct.

Your first example is correct for single select, the last one for multiselects.

Or are you saying you want to apply this condition on workflows where Region could be any of those cf types?

 

 

 

Thanks Jamie, the message under warning looked as if it couldn't find the custom field and hence was worried to get that fixed.

BTW I'm not looking for
>> Or are you saying you want to apply this condition on workflows where Region could be any of those cf types?

So I'm good for now.

Thanks.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Asked 6 hours ago in Confluence

What are the resources that you use to learn more about Atlassian Products?

I am gathering information about resources available for Atlassian product knowledge transferring for a presentation in our local Atlassian User Group. I want to group them in four categories From ...

49 views 3 3
View question

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