Hi,
I want to check if all linked issues are closed, but its not working... Don't know why.
It's created in Misc workflow extensions as post-function.
Thank you for any advice.
My script:
When I do any action, there is debug output like "Unable to find field 'id'"
import com.atlassian.jira.ComponentManager import com.atlassian.jira.ManagerFactory //import com.atlassian.jira.config.properties.APKeys import com.atlassian.jira.issue.link.IssueLinkImpl def componentManager = ComponentManager.getInstance() def issueLinkManager = componentManager.getIssueLinkManager() def closedIssues = true; issueLinkManager.getInwardLinks(linkedIssue.id).each {issueLink -> if (!(issueLink.getStatusObject().getName().toUpperCase() == "CLOSED")){ closedIssues = false; //break; } } return closedIssues;
I also tried it with "issue.id" instead of "linkedIssue.id"... Same response.
This is "help" from post-function script editor:
Community moderators have prevented the ability to post new answers.
Maybe you need to use "issueObject" isntead issue. Im using that:
import com.atlassian.jira.ComponentManager import org.apache.log4j.Category import com.atlassian.jira.issue.link.IssueLink; import com.opensymphony.workflow.InvalidInputException log = Category.getInstance("com.onresolve.jira.groovy.LinkedIssues") log.warn("issue key: " + issue.key) passesCondition = true testlinkType = ["Relates"] //your issue link type linkMgr = ComponentManager.getInstance().getIssueLinkManager() for (IssueLink link in linkMgr.getInwardLinks(issue.id)) { log.warn("linked issue type: " + link.issueLinkType.name) log.warn("linked issue key: " + link.getSourceObject().getKey()) log.warn("linked issue status (name): " + link.getSourceObject().getStatusObject().getName()) log.warn("linked issue status (id): " + link.getSourceObject().getStatusObject().getId()) if ((testlinkType.contains(link.issueLinkType.name))) //to execute an action if link equals to { } }
Just work on this code, here you have everything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the update @Flavio Beck
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.
try linkedIssueObject instead linkedIssue
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.