Behaviours Plugin : Nothing happen when I modify a select field

Manuel Campomanes
Contributor
March 22, 2012

Hello,

I'm using Jira 4.4 and Behaviours-jira-0.5.0

I try to modify a select field according to another select field value, like the example with component and subcomponent (here).

I make that :

FormField f01 = getFieldById(fieldChanged)
FormField f02 = getFieldById("customfield_10902")

Map fieldOptions = [:]
fieldOptions.putAll([10030:"Lemons", 10031:"Oranges"])

f02.setFieldOptions(fieldOptions)

The mapping is OK. But the second field stay empty and I have no errors in log file :

/secure/admin/EditValidator.jspa [onresolve.jira.groovy.ViewBehaviours] updateValidator
 /secure/admin/EditValidator.jspa [onresolve.jira.groovy.ViewBehaviours] Clear GroovyClassLoader class cache.
 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json [onresolve.jira.groovy.BehaviourManagerImpl] Returning map: [customfield_10902:[fieldOptions:[10030:Lemons, 10031:Oranges], fieldType:com.atlassian.jira.plugin.system.customfieldtypes:select, displayName:f02]]

I don't understand why.. Just another question, where can I find documentation about com.onresolve.jira.groovy.user.??? like Formfield

Thank you.

1 answer

0 votes
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 Leaders.
March 22, 2012

[10030:"Lemons", 10031:"Oranges"] need to be valid options (IDs and names) for the select list.

All that setFieldOptions can do is effectively remove options, not add ones that don't exist.

> Just another question, where can I find documentation about com.onresolve.jira.groovy.user.??? like Formfield

The important stuff is inline under the script editor, but the rest is in the source code :-(

Suggest an answer

Log in or Sign up to answer