Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

from 'is blocked by' to 'blocks condition evatluation

Quinton Lephoto April 25, 2019

Good day friends, i have this code below that evaluates the issue links under the 'is blocked by' issues but now i need to redirect this to test for the 'block' issue types.

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.issue.link.IssueLink;
import com.opensymphony.workflow.InvalidInputException

IssueLinkManager linkMgr = ComponentAccessor.getIssueLinkManager()

if( linkMgr.getInwardLinks(issue.getId())*.issueLinkType.name.contains('Blocks') )
{
def counter = 0
for (IssueLink existingLink in linkMgr.getInwardLinks(issue.id))
{
def enh = existingLink.getSourceObject().getIssueType().toString().contains('Enhancement');
def sysEnh = existingLink.getSourceObject().getIssueType().toString().contains('System Enhancement');
def sto = existingLink.getSourceObject().getIssueType().toString().contains('Story');
def pro = existingLink.getSourceObject().getIssueType().toString().contains('Product');
def proIss = existingLink.getSourceObject().getIssueType().toString().contains('Production Issue');
def mis = existingLink.getSourceObject().getIssueType().toString().contains('MIS Story');
def bug = existingLink.getSourceObject().getIssueType().toString().contains('Bug');

if (enh || sysEnh || sto || pro || proIss || mis || bug)
{
counter++
}
}
if(counter > 0)
{
return true
}
}

0 answers

Suggest an answer

Log in or Sign up to answer