Thanks Cody,
I run script but get error "
Error
startup failed: Script6.groovy: 33: expecting anything but ''\n''; got it anyway @ line 33, column 88. dationResult.errorCollection") ^ 1 error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueInputParametersImpl
import com.atlassian.jira.config.SubTaskManager
Issue issue = issue
def constantManager = ComponentAccessor.getConstantsManager()
def issueService = ComponentAccessor.getIssueService()
def cwdUser = ComponentAccessor.jiraAuthenticationContext.getUser()
SubTaskManager subTaskManager = ComponentAccessor.getSubTaskManager()
Collection subTasks = issue.getSubTaskObjects()
if (subTaskManager.subTasksEnabled && !subTasks.empty) {
subTasks.each { Issue it ->
String comment = "*Resolving* as a result of the *Resolve* action being applied to the parent.";
def issueInputParameters = new IssueInputParametersImpl()
def doneResolutionId = constantManager.getResolutionObjects().find {it.name == "Done"}?.id
def doneStatusId = constantManager.getStatusObjects().find {it.name == "Done"}?.id
issueInputParameters.setResolutionId(doneResolutionId).setStatusId(doneStatusId).setComment(comment)
def transitionValidationResult = issueService.validateTransition(cwdUser, it.id, 21, issueInputParameters)
log.debug("Validation result : " , transitionValidationResult.errorCollection")
if (transitionValidationResult.isValid()) {
log.debug("Transition for sub task " + it.key + " is valid")
issueService.transition(cwdUser, transitionValidationResult)
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
Just for info and future reference: the documentation has moved to a new site and this would be the link to Auto Close Subtasks if you are using a more recent version of JIRA (i.e version 7.x) and ScriptRunner (version 4.x).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Mark!
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.
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.