I have the following condition (we don't want to resolve any Incident children until the parent Event). But It's not working
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
import org.apache.log4j.Category
import com.atlassian.jira.issue.link.IssueLink;
import com.opensymphony.workflow.InvalidInputException
def Category log = Category.getInstance("com.onresolve.jira.groovy.LinkedIssues")
Boolean passesCondition = true
IssueLinkManager linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getInwardLinks(issue.id)) {
log.error(link.getIssueLinkType().getName())
log.error(link.getSourceObject().getResolution())
if (link.getIssueLinkType().getName().toString() == "Parent") {
passesCondition = false
}
}
As I understood, there is a link between two issues with a name "Parent" (not real parent/subtask relation). So, please notice the link direction whether outward or inward.
If there is an outward link, you should use; getOutwardLinks and getDestinationObject() within the code.
Also, please check the Link Name from Admin -> Issue -> Issue Linking page.
If statement executes succesfully. I debug It using log.error statement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.