Forums

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

Behaviours won't update custom field from plugin

Joe Mallon
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 Champions.
August 27, 2021

I have a custom field using this plugin:

https://marketplace.atlassian.com/apps/1211608/color-custom-fields

The structure of the field value is:

'customfield_15000' => {
'id' => '19106',
'self' => 'https://BLAH.com/rest/api/2/customFieldOption/19106',
'value' => 'Yellow'
},

When I try to update the field value using Behaviours, the field is set to null. Example:

def rp = getFieldByName("Risk Profile")
def rv = rp.getFormValue()
rp.setFormValue("Yellow");

I have also tried with:

rp.setFormValue("19106");

and

rp.setFormValue(19106);

In all cases, Risk Profile is set to null. In fact, just clicking the tab on which the Risk Profile form field sits sets it to blank, even without changing the field that should trigger the update of Risk Profile.

Is there a better way to set a form field or a value when the form field is non-standard?

Alternately, is there such a thing as an Edit post-function where I could set the value more programmatically?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events