In JIRA 6.4.6, I am trying to create a script listener using Script Runner using an inline script. Basically, if the Affects Version/s is updated on a parent issue, I want to update all of its subtasks with those same values in Affects Version/s, as well.
This is the script that I have so far. It works as is, but I don't know how to actually set the Affects Version/s field value on the subtasks.
import com.atlassian.jira.component.ComponentAccessor
def affectsVersions = issue.getAffectedVersions()
def commentManager = ComponentAccessor.getCommentManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getUser()
def subtasks = issue.getSubTaskObjects()
subtasks.each {
commentManager.create(
it,
user,
"New Affects Version/s: " + affectsVersions,
false)
//works correctly up to here. don't know how to set Affects Version/s field value
}The comment I create shows up on all of the subtasks correctly. What method(s) should I use to set the field value? I'm still fairly new to groovy scripting and the JIRA API documentation and I'm failing to locate the methods I need.
Thanks for your help!