Forums

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

cannot find matching method cfValues in script runner

Nataraju Gokeda
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 19, 2020

 

In this code I am getting this error:

cannot find matching method cfValues in script runner

Please help fixing it

 

 


def values = cfValues('Multi Select').value
if ( values.contains('Option 1') || values.contains('Option 2') || values.contains('Option 3')) {
return true
} else {
return false
}

2 answers

3 votes
Hana Kučerová
Community Champion
July 19, 2020

Hi @Nataraju Gokeda ,

welcome to the community!

If you have Jira cloud, it won't work for you, because it looks like code for server version.

Where exactly are you trying to use this code? Is this some kind of validator / condition?

If so, please, look at these articles:

Nataraju Gokeda
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 21, 2020

Hi Hana...Yes I am using cloud version
the code is for post function....adding a sub task based on value of Multi Select Field

 

0 votes
Kristian Walker _Adaptavist_
Community Champion
July 27, 2020

Hi Nataraju,

I can confirm that the following example located inside of the ScriptRunner for Jira Cloud documentation on the page here shows an example Script Console script to extract the values from a Multi Select List field.

You will be able to use this example to see how to extract the values from a Multi Select List field inside of your script in order to help create the script that you require to create a subtask when the Multi Select List field contains the option you require it to contain.

I hope this information helps.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer