Hey guys,
I am new to JIRA and I am trying to update issue with a Groovy script. ( I use ScriptRunner with JIRA server. )
I wrote this simple function and I try to run it from the ScriptRunner console -
def Epic_Update_List_Field(epic_id, field_name, field_value)
{
def issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("$epic_id")
def select_singlechoice_field = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("$field_name")
select_singlechoice_field.updateValue(null, issue, new ModifiedValue("", (Object) getOptions(issue, select_singlechoice_field, ["$field_value"]).get(0)), new DefaultIssueChangeHolder())
}
The error I am getting is -
groovy.lang.MissingMethodException: No signature of method: first_epic.second_sync.getOptions() is applicable for argument types: (com.atlassian.jira.issue.IssueImpl, com.atlassian.jira.issue.fields.ImmutableCustomField...) values: [MAZ-87, SW Team, [WorkStation]]
at first_epic.second_sync.Epic_Update_List_Field(second_sync.groovy:519)
at first_epic.second_sync$Epic_Update_List_Field$1.callCurrent(Unknown Source)
It seems that the arguments I use for the getOptions() problem are wrong but I don't understand why.
I took the script from this post -
Any help would be appreciated. :)
Thanks in regard.