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
Use https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/customfields/manager/OptionsManager.html for that
Thanks Alexey,
How will the issues with existing option values will be updated if I use <strong><a href="https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/customfields/manager/OptionsManager.html#updateOptions(java.util.Collection)" rel="nofollow noopener noreferrer">updateOptions</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" rel="nofollow noopener noreferrer">Collection</a><<a href="https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/customfields/option/Option.html" title="interface in com.atlassian.jira.issue.customfields.option" rel="nofollow noopener noreferrer">Option</a>> options)
<strong><a href="https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/customfields/manager/OptionsManager.html#updateOptions(java.util.Collection)" rel="nofollow noopener noreferrer">updateOptions</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" rel="nofollow noopener noreferrer">Collection</a><<a href="https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/customfields/option/Option.html" title="interface in com.atlassian.jira.issue.customfields.option" rel="nofollow noopener noreferrer">Option</a>> options)
Do i need to perform a re-index or this should be automatically done ?
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)
I used
optionsManager.setValue(Option, "<New Value>")
and it works as expected.
Thanks a ton ..!!
Regards,
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
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
Need to rename about 200 values in a given custom field
It looks like you're new here. Sign in or register to get started.