ScriptRunner Behavior for set Default Value Bug

SMAtlassianMber January 29, 2021

Every script I try to set a default value turns the field into an un-editable field, as the default has become a permanent selection and will not let the user change it. We are using SR 5.6.15.1-p5 in Jira Data Center 8.5.3. Has anyone else ran into this problem? Just wondering if this is this a bug or a script error? 

 

Both these scripts set the default, but then the field section can not be changes. 

Example 1 - https://library.adaptavist.com/entity/set-a-default-option-on-a-select-list

Example 2- https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/setting-default-fields.html#_setting_defaults_for_selects_etc

 

1 answer

1 accepted

0 votes
Answer accepted
Amirul _Adaptavist_ February 13, 2021

Hi there,

For example 1, you would need to implement the scripts on the initialiser instead of server-side script.

Since the server-side script will run the script every time you want to make changes on the select list hence the behaviour that you are seeing.

Regard,

Amirul

SMAtlassianMber February 16, 2021

That makes perfect sense, thank you for pointing that out. I will give it another try using the initializer instead. 

SMAtlassianMber February 16, 2021

 

@Amirul _Adaptavist_ That worked and now it can be changed from the default, but now there is a new problem. After the field value is changed from the default and you go back in to edit any field, the default is pre-populated, instead of showing what was selected. Once you save, it changes the field, so there is no way to keep your selection if changed from the default. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events