Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Select List value not getting Updated

Hemanshu Sood
Contributor
October 9, 2018

Hi all,

 

I had created a script to update a select list in Jira from an existing value to a new one.

Unfortunately , the select list value is not getting updated, while there are no errors in logs, please suggest:

 

def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
log.error("User: $currentUser")
if (ComponentAccessor.getUserUtil().getGroupNamesForUser(currentUser.name).contains("Custom Group"))
{
def cfSelect = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Select List ")
def cfConfig = cfSelect.getRelevantConfig(issue)
def value = ComponentAccessor.optionsManager.getOptions(cfConfig)?.find {
it.toString() == 'REJECTED'
}
issue.setCustomFieldValue(cfSelect, value)
}

2 answers

0 votes
Hemanshu Sood
Contributor
October 10, 2018

Now getting below error:

 

groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method com.atlassian.jira.issue.fields.CustomFieldImpl#getRelevantConfig.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
 [interface com.atlassian.jira.issue.Issue]
 [interface com.atlassian.jira.issue.context.IssueContext]
 [interface com.atlassian.jira.issue.context.JiraContextNode]
 at Script168.run(Script168.groovy:10)

Any help would be appreciated 

0 votes
Hemanshu Sood
Contributor
October 9, 2018

Any update would be helpful, Thanks in advance

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events