Jira Cloud
Scrum Teams
Scrum Teams
Case: We clone template issues, as our work is repetitive, and get “clone” in the summary and it makes it hard to read. Built-In Jira allows you to remove "Clone" from the story you are cloning, but if you are also copying the sub-tasks there is not the option to remove it. There are ways to turn this off in Jira Server, but I could not find it in Jira cloud.
Solution:
Jira - Settings - Add-Ons - ScriptRunner - Escalation Service
The Escalation Service called: Remove Clone In Summary
As this user: (myself)
Checked - enabled
On this schedule: Every Hour
For first 50 results returned by this query: Project in (pipe) and Summary ~ "CLONE"
Will run this code:
// check if issue.fields.summary looks like "CLONE -"
def updatedSummary =""
if (issue.fields.summary.startsWith("CLONE -")) {
//if so, modify issue.fields.summary to not suck.
updatedSummary = issue.fields.summary.replace("CLONE -", "")
//update it.
def result = put('/rest/api/2/issue/' + issue.key)
.header('Content-Type', 'application/json')
.body([
fields: [
summary: updatedSummary
]
])
.asString()
if (result.status == 204) {
// If you want to leave a comment, you can add this
//def commentResp = post("/rest/api/2/issue/${issue.key}/comment")
// .header('Content-Type', 'application/json')
// .body([
// body: """The ScriptRunner Bot has updated the description of ${issue.key} due to the name looking like CLONE -"""
//])
return "Updated summary of ${issue.key}"
} else {
return "Failed to update: ${issue.key}. " + "${result.status}: ${result.body}"
}
}
Comments
Post a Comment