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)
}
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
Any update would be helpful, Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.