add options to select list using groovy

I want to configure groovy as a service and read values from a file.

Based upon the values I wanted to add options in a select list type custom field.

is it possible ? if yes .. How ?

Thanks in advance,


3 answers

1 accepted

2 votes
Accepted answer

I think, you could take a look at the built-in script to add values to custom fields, to see how you can add options to custom fields. The OptionsManager is the interesting point.

But you have to be aware that you shouldn't delete Options which where in use (if this is possible at all). You can delete unused options and deactivate used options if they should not be available anymore. So you have to implement some kind of "sync" between your file and the available options...

Hi Henning,

i am not finding reference code anywhere for bulk import custom field value function anywhere{which can help me save some time}.

Can you please share the code, so that it can help me in writing a new one ?

Thanks and regards,


If you go to the script runner builtin scripts page, select the script "Bulk import custom field values" there is a link "View source". In the doScript method is a part where new options are created, see optionsManager.createOption() or

Thanks a lot ... I think this will help.

for example ... say I have read a , b, c, d, e & f from the file and I want to create these as option in the select list.



This is not related to what I am looking for.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

478 views 8 28
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you