Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×Greetings Mates,
Can anyone help me to write a code to update options in a " Single Select" customer filed value ? I am absolutely new to Jira and scripting on it. I just could succeed to use my groovy now for running simple scripts as post functions.
Now I have a Single Select custom filed. It is a general custom filed being used by many issues.
I need to add some options on it and update the options sometimes.
I could find below question very similar to mine , but in the answer it is clear that options for an specific issue or issues will be updated by running the script.
In my case , I am going to update a custom field independent to the issues.
This is my code. I can call the custom filed by its ID (thanks to sample scripts).
Now I need to update its options ...
It would be appreciated to have your advices and supports.....
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.fields.config.manager.FieldConfigManager
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()
def myCustomField1 = customFieldManager.getCustomFieldObject("customfield_10221")
?
?
?
Link of the similar question
Another one that I could find when writing this question :)
but without answer...
Welcome to the community and thank you for creating your first question :) ..
When looking at your problem I am wondering if you really need a script.. Definitively adding an option to Select List should be easy to do via UI..
And then.. Updating a value probably means that you have some conditions.. If condition is met you would update the field and choose this new value.. Is that correct?
Maybe we can simply use a standard Bulk Change.. Everything depends on the scale. You were saying "many issues" so I am wondering how many there are actually..
Could you please clarify a little bit more on effort that is required?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.