I want to add a new option to a custom field from an issue. For example, when an issue is created and a field contains the value "Milk", I want that value to be added as an option to the "Groceries" custom field.
How can I achieve this? Can it be done using ScriptRunner or another approach?
Hi and welcome to the community,
On Cloud also Scriptrunner is dependant on what Atlassian exposes via REST API. But good news! There is a documented REST api doing exactly that:
Have a look at the documentation. You can either use HAPI within Scriptrunner (if this particular call is available), if not you can still just do a REST request following the documentation in the link.
As a matter of fact there is an exact example of this in the Scriptrunner library:
https://www.scriptrunnerhq.com/help/example-scripts/add-options-to-custom-field-cloud
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.