Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello everyone. I have a part of my script:
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)
cloned.summary = "["+projectRelease+"]"+cloned.getSummary().replace("[Project name]"," ")
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]"," "))
}
}
I want to change summary for this scripts. But I can't do It. Summary is not changing and I don't know why (even using setSummary() method
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.