Skip to content

Instantly share code, notes, and snippets.

@jechlin
Created January 8, 2014 21:17
Show Gist options
  • Save jechlin/8324824 to your computer and use it in GitHub Desktop.
Save jechlin/8324824 to your computer and use it in GitHub Desktop.
repoen subtasks
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.onresolve.jira.groovy.canned.utils.WorkflowUtils
def issue = issue as Issue
// ---------------- CONFIGURE THIS --------------------------
def actionId = 3 // action ID to reopen a subtask
// ----------------------------------------------------------
def user = WorkflowUtils.getUser([transientVars: transientVars])
if (issue.isSubTask()) {
log.warn("This function should not be applied to subtask workflows")
}
else {
issue.subTaskObjects.each {subtask ->
if (WorkflowUtils.hasAction(subtask, actionId)) {
WorkflowUtils.actionIssue(null, subtask as MutableIssue, actionId, user, [:])
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment