Hi all,
I need to add a scriprunner validator in the Create linked issue function to check the status of the linked issue.
Is it possible to do it?
The problem is that in the validation phase, I cannot get any linked issue. Maybe this is a two phase function, where in the first the issue will be created and in the second the link will be added?
This is the function thai I use to get the linked issue by link name:
def getInwardIssueList(linkType, issue) {
def result = new ArrayList();
List<IssueLink> allInIssueLink = ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId());
for (Iterator<IssueLink> outIterator = allInIssueLink.iterator(); outIterator.hasNext();) {
IssueLink issueLink = (IssueLink) outIterator.next();
//log.error(issueLink.getIssueLinkType().getName())
if (issueLink.getIssueLinkType().name == linkType) {
//def linkedIssue = issueLink.getDestinationObject()
def linkedIssue = issueLink.getSourceObject()
String type = linkedIssue.getIssueType().getName();
result.add(linkedIssue);
}
}
return result;
}