When I change the status from "in progress" to "Closed". I want to validate the Issue that must have at least one "Child of" linked issue and all "Child of" linked issues are “Closed”.
Hi @Diego Chen
You can't do that with out-of-the-box Jira. But, you can achieve this using ScriptRunner if you are free to use an app.
Add a ScriptRunner script validator for your workflow transition. The script will be similar to the one below, there might be some issues with the code but I trust it will be a good start.
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.link.IssueLinkimport com.atlassian.jira.issue.link.IssueLinkManagerimport com.atlassian.jira.workflow.WorkflowFunctionUtilsdef issueLinkManager = ComponentAccessor.getComponent(IssueLinkManager)def childOfLinks = issueLinkManager.getOutwardLinks(issue.id).findAll { link ->link.issueLinkType.name == "Child of"}if (childOfLinks.isEmpty()) { // No "Child of" linked issues, validation fails here return false }def allLinkedIssuesClosed = childOfLinks.every { IssueLink link -> link.destinationObject.status.name == "Closed"}return allLinkedIssuesClosed
It looks like you're new here. Sign in or register to get started.