I created an automation rule that works flawlessly when a new sprint is created, a task and subtask is created. However, it started duplicating the task and subtask mid month for no reason and there are no triggers from the rule created?
Hello @Andrew Striletskyi
add this after setSummary()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
ComponentAccessor.getIssueManager().updateIssue(user, cloned, EventDispatchOption.ISSUE_UPDATED, false)
imports
import com.atlassian.jira.event.type.EventDispatchOption
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Your script should look like this:
import com.atlassian.jira.event.type.EventDispatchOption
def newArtifactCreate = issueManager.createIssueObject(issue.reporter,newArtifactIssue)
def subtasks = artifactIssue.getSubTaskObjects()
if (subtasks) {
subtasks.each { subtask ->
def toclone = issueFactory.cloneIssue(subtask)
def cloned = issueManager.createIssueObject(issue.reporter,toclone)
subtaskManager.createSubTaskIssueLink(newArtifactIssue,cloned,issue.reporter)
def labels = labelManager.getLabels(cloned.id).collect{it.getLabel()}
labels -= 'Template'
labelManager.setLabels(user,cloned.id,labels.toSet(),false,false)
cloned.setSummary("["+projectRelease+"]"+cloned.getSummary().replace("[Project name]"," "))
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
ComponentAccessor.getIssueManager().updateIssue(user, cloned, EventDispatchOption.ISSUE_UPDATED, false)
}
}
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.