Get status of linked issues?

ahmed salem November 12, 2020

Hello there,

 

I'm quite new to Jira postfunctions.

 

I'd like to do nothing in an if condition if the linked issue if of type Bug(Customer) and the linked issue status is new. I have the below code:

 

linkManager.getLinkCollectionOverrideSecurity(issue).getAllIssues().each { linkIssue->
if (issue.getProjectId() == linkIssue.getProjectId() && linkIssue.issueType.name == 'Task') {
releaseName = linkIssue.getCustomFieldValue(releaseNameField)?.toString()
} else if ((linkIssue.issueType.name == 'Bug (Customer)') && (linkIssue.getStatusId().equals("1")) ) {
log.warn("Doing nothing here")
log.warn ("The link issue status is" + linkIssue.getStatusId())
} else {
linkedIssues.add(linkIssue)
}
}

 

However, nothing happens. I think the problem is with "linkIssue.getStatusId().equals("1"))

 

One more question. When I use log.warn messages, where do they show up? In the console? Or somewhere else?

 

Thanks for all your help

1 answer

0 votes
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 12, 2020

Which app are you using? ScriptRunner ? JMWE ?

ahmed salem November 12, 2020

Thanks David for the quick reply :)

 

I'm using a ScriptRunner post-function.

 

I found this online:

 

def destIssue = link.getSourceObject();

if(!destIssue.getStatusId().equals("10000")){ //Ex Status id of DONE
passesCondition = false;

 

But was hoping to get it done in one step.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events