Forums

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

Show custom field based on Component using Scriptrunner behaviours

jamila.augustine
Contributor
March 17, 2020

Hi I am trying to create a behaviour to show a custom field based on component value.

I have read the previous helpful articles and have the following script

def comp = getFieldById(COMPONENTS)
def values = comp.getValue()*.getName()

def tatr = getFieldById('customfield_14310')

tatr.setHidden(true)

if(values.toString().contains("test"))
{
tatr.setHidden(false)

}

This shows a spread operator error on line 2 (def values) and hides the custom field  no matter what.

 

Can someone give me a hint what could be wrong?

Thanks

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events