I need to add fix version for the linked issue. But script I've wrote doesn't take effect.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.link.IssueLink
import com.atlassian.jira.user.ApplicationUser
String processBlockingIssue(MutableIssue origin, Issue issue) {
ApplicationUser user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
issue.fixVersions.addAll(origin.fixVersions)
ComponentAccessor.getIssueManager().updateIssue(user, issue, EventDispatchOption.ISSUE_ASSIGNED, true);
return origin.fixVersions.join(",");
}
MutableIssue issue = ComponentAccessor.getIssueManager().getIssueObject("LIC-197");
MutableIssue myIssue = issue
List<IssueLink> links = ComponentAccessor.getIssueLinkManager().getOutwardLinks(myIssue.id)
String str = "";
for (IssueLink link : links) {
if ("Blocks".equalsIgnoreCase(link.issueLinkType.name)) {
str += processBlockingIssue(myIssue, link.destinationObject)
}
}
str;I get result "0,5" after calling script in script console. That is only version that alredy assign to issue LIC-197. I have issue LIC-196 that blocks by LIC-197.
Issue LIC-196 and fixVersion define correctly. But issue is not updated.