Scriptrunner - Set existing select field value

Kristian Koniarz November 24, 2020

Dear Community,

I got an single select field with 3 pre-configured options.

def availableOptions = ComponentAccessor.optionsManager.getOptions(customField.getRelevantConfig(issue))
return availableOptions

How can I set one of those, without creating a new value in a post function?

Like, pseudo code:

if (A == B) {

if (A == B) {
set single select field to option 2
} else {
set single select field to option 3
}

Best,

Kristian

1 answer

1 accepted

0 votes
Answer accepted
Raziman Dom - Ricksoft
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2020

Hi @Kristian Koniarz

This article "Set a Default Option on a Select List" a good reference if you want to set a value to a single list:

Then you just need to apply your if-else statement logic to that script.

Where do intended to run this script?

What do you mean by "without creating a new value in a post function"?

Suggest an answer

Log in or Sign up to answer