edit select list options using groovy

Sumit Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2014

I have a select list with options a b c d e

I need to rename option a with A using groovy.

What method i can use from API to perform a similar task.

Thanks,

Sumit

2 answers

1 accepted

1 vote
Answer accepted
Alexey_Rjeutski__Polontech_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2014
Sumit Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2014

Thanks Alexey,

How will the issues with existing option values will be updated if I use updateOptions(Collection<Option> options)

Do i need to perform a re-index or this should be automatically done ?

Thanks,

Sumit

Alexey_Rjeutski__Polontech_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2014

The options themselves will be updated instantly. As for the cached index - you should reindex jira to get the new options in search results. (but inside the issues actial values will link to the new option value)

rikkin patel March 8, 2016

Hi Alexey,

Will you be able to help me write a script for it? I am new to scripting and wouldn't know where to begin... Sorry sad

Need to rename  about 200 values in a given custom field 

Best,

Rikkin

0 votes
Sumit Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2014

I used

optionsManager.setValue(Option, "<New Value>")

and it works as expected.

Thanks a ton ..!!

Regards,

Sumit

rikkin patel March 8, 2016

Hi Sumit,

Will you be able to please share the full script? I am trying to achieve the same thing. Need to rename  about 200 values in a given custom field. 

Best,

Rikkin

Suggest an answer

Log in or Sign up to answer