This post is the continuation of:
Now in the second part of the post we want the same thing, but not “hardcoded”. We want to create new tickets based on a description of an existing Jira ticket (and we will use this kind of tickets as templates).
It’s very easy! Just see this code:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.IssueManager IssueManager issueManager = ComponentAccessor.getIssueManager(); def issueobtained = issueManager.getIssueObject("ISSUE_KEY"); def desc = getFieldById("description") //def defaultValue = """ // //""".replaceAll(/ /, '') if (! underlyingIssue?.description) { desc.setFormValue(issueobtained.description) }
Just replace ISSUE_KEY with the Key of the Jira ticket that we will use as template (its description field of course)
If we want more, we can save more time and money using the plugin “Description Templates for Jira” and/or “Description Templates for Jira Cloud“. And it’s FREE!
Description Templates for JIRA
By MrAddon