Hey Community,
In Script Runner Cloud, how can i set the value of the "labels" field to a string that i have?
for example i'm trying to do this:
getFieldById('labels').setValue('LEFTFIELD')
But getting the error:
Argument of type 'string' is not assignable to parameter of type 'LabelsField'
This is happening on the "On Load" function on the create screen.
how can i fix this?
Thanks
Ariel.
Hi Ariel,
I can confirm that in Behaviours for ScriptRunner Jira Cloud you must set the label field using an Array of strings e.g ["label-1","label-2"] as described in the UI Modification API documentation page here.
You can also see the structires to use to set field values inside our documentation page here and this will help you to see what format to use when writing behaviours scripts.
This means in your script if you do something similar to below then it will work.
getFieldById('labels').setValue(['LEFTFIELD'])
I hope this information helps.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.