Hello everyone,
My objective is to be able to automaticaly transistion ticket from the JSD (Yes I'm still on a previous version) when all linked ticket in other projects in my instance are closed.
This is used for user account creation and require many teams to have their own tickets within their project. Hence the reason I cannot use an automation within JSD.
I've been looking into scriptrunner to help me out but I'm not a dev but have basic knowledge on coding language.
I'm trying to use fast-track on the transition "Mark as transfer", which is setting the status to "Transferred" (Pending), on the post function that should validate that all linktype issue on are "relates to" closed to do action "Mark as resolved" from my workflow when issue is set to transferred.
This is the code I have entered in the condition box found on https://scriptrunner.adaptavist.com/5.2.2/jira/recipes/workflow/conditions/all-dependent-issues-resolved.html
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLink
def linkType = ["relates to"]
def linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getInwardLinks(issue.id)) {
if (linkType.contains(link.issueLinkType.name)) {
if (! link.sourceObject.resolutionId) {
passesCondition = false
}
}
}
I have found someone else with a similar issue with this script here but even trying his modification to the script I still have an error within the coding box that mention
[Static type checking] - The variable [passesCondition] is undeclared at @ line 10, column 713
I've also added in additinal issue actions box the following code from the snippets hoping it would fix it but nothing is happening.
import com.atlassian.jira.component.ComponentAccessor
def constantsManager = ComponentAccessor.getConstantsManager()
def resolution = constantsManager.resolutions.findByName("Done")
issueInputParameters.setResolutionId(resolution.id)
When publishing my workflow and testing my ticket which have tickets linked as relates to to the status "Mark as transfer" nothing is happening.
I have check the post functions and it say no failures but I have no log either.
Jira: 8.5.2
Scriptrunner: 6.0.0-p5
If you have something else to propose then this script I am open for suggestion.