We want to setup a post-function that resolves an issue when linked issues are resolved (if there are linked issues to the issue). So as an example, if "is blocking" issues are resolved, it will automatically resolve "is blocked by" issues.
Looking at Scriptrunner's "Fast-track transition an issue" but unsure of the condition to use. Or open to other solutions (maybe a Bob Swift solution?)
I assume you are looking at the documentation at https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_fast_track_transition_an_issue which includes how to transition a parent issue when all linked tasks are closed. The example provided in here showing auto closure refers to subtasks and the entry needs to go on the workflow of the subtask to trigger the check and potential closure.
If however, you are looking at any linked issues I assume that you have a business case similar to this...
All related issues are linked together and when one is resolved then all such issues should be resolved automatically.
For this you should probably check the link is of a specific type and again the post-function would go on the closure transition in the workflow applying to each issue.
Without checking your link type you risk closing all issues regardless of whether they meet your business case or not.
Perhaps you could confirm in more detail the business case you are trying to solve?
I have a similar case. We have a project that has a specific issue type that when created automatically generates a series of tickets in other projects. Once all the linked issues are resolved we would like the original ticket to be resolved. I have tried to use the "Fast Track transition" script runner listener, but I am having issues with setting up the condition? So far I have the below.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink
def linkType = ["created"]
def linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getInwardLinks(issue.id)) {
if (linkType.contains(link.issueLinkType.name)) {
if (! link.sourceObject.resolutionId) {
passesCondition = false
}
}
}
One of the problems is that this condition would require a trigger from the main ticket. What I actually need is a rule that would run on each of the linked issues that would check the other linked issues to see if the others are already resolved and if so it would automatically close the main ticket without needing any interaction from the user.
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.