I am experiencing the above the script below. I am trying to pass the fix version to the story from the epic to ensure that the story has the same fix version as the epic.
The second error I get is: Unable to Resolve Class Mutable and Unable to resolve Class IssueLink
Jira Version 8.0.1
Scriptrunner: 5.5.6.1-jira8
Below is the script:
import com.atlassian.jira.issue.link;
import com.atlassian.jira.component.ComponentAccessor;
def issue = event.issue
if(issue.issueType.name == "Epic")
{
def projectKey = issue.projectObject.key
def change = event?.getChangeLog()?.getRelated("ChildChangeItem.find").find{it.field == "Fix Version"}
def issueLinkManager = ComponentAccessor.issueLinkManager;
def issueManager = ComponentAccessor.issueManager;
if(change)
{
issueLinkManager.getOutwardLinks(issue.getId()).each {IssueLink issueLink ->
if(issueLink.getIssueLinkType().getName() == "Epic-Story Link")
{
def destinationIssue = (MutableIssue)issueLink.getDestinationObject();
if(destinationIssue.projectObject.key.equals(projectKey))
{
destinationIssue.setFixVersions()
issueManager.updateIssue(event.getUser(), destinationIssue, EventDispatchOption.ISSUE_UPDATED, false)
}
}
}
}
}
Please assist
Hi, @Shawn Danisa
Make sure your imports look like this:
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.link.IssueLink;
import com.atlassian.jira.component.ComponentAccessor;
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.