I have a Jira Software project where the team has asked for a very specific change to the workflow:
When a new issue is created and the issue type is ABC, update the Epic field for that issue to be in the XYZ epic.
Once caveat: Any changes I make can't break jira's automatically created workflow. This means what when the team adds new status' or scrum board columns later, my change should still be in place. I'm hoping, because the change will be on create, that's not likely to be a problem
Hi Crystal,
I can't really help with ScriptRunner, but if you don't find a solution, you can certainly do it easily with JMWE's Set Field Value post-function. Let me know if you decide to go that way and need help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Something close to this should work for you as a post function on the create transition:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
def issueType = "Your issue type" // the issue type you want use this with
def epic = "Your epic key" // the key of the epic you want to link to
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def issueManager = ComponentAccessor.getIssueManager()
def epicLink = customFieldManager.getCustomFieldObjects(issue).find{it.name == "Epic Link"}
def newEpic = issueManager.getIssueObject(epic)
MutableIssue issue = issue as MutableIssue
if(issue.issueType.name == issueType){
issue.setCustomFieldValue(epicLink, newEpic)
}
Let me know if you have any further questions, or had something else in mind. :)
Jenna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.