Hi,
I am using Jira 6.2.7. I am trying to set value of a list field using script runner post function. I have tried below code. However option is always returned as null. I do have value 'Jira-Tier1' defined in the list with other values. There are no errors in the log. Thanks for your help!
def optionsManager = componentManager.getComponentInstanceOfType(OptionsManager.class)
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Assignee Group'}
if(cf != null){
def fieldConfig = cf.getRelevantConfig(issue)
def option = ComponentAccessor.optionsManager.getOptions(fieldConfig).find {it.value == 'Jira-Tier1'}
log.debug ("Options is ${option}")
issue.setCustomFieldValue(cf, option)
issue.store()
}
Rama
Thanks Jamie! I did verify the value and also read the value of that field in the script and printed it. I don't see any spaces. Any other pointers?
Appreciate your help!
You might have a space after "Jira-Tier1" or something...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie! I did verify the value and also read the value of that field in the script and printed it. I don't see any spaces. Any other pointers?
Appreciate your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should edit the issue using com.atlassian.jira.bc.issue.IssueService#validateUpdate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
I would appreciate if you could help me with an example if possible? I am a begineer in this area and struggling a bit to get this working.
Thanks for your help!
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.