Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

issue link script problem


Im trying to read  the linked issues of a specific issue. But the script is only reading the epic link issue.

PA-2000 have a linked issue  OB-1111 also have and epic Link = OB-50

I want to make a transition on OB-1111 but the script never read it. the script only reads the epic link OB-50

following my code.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.issuetype.IssueType
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.bc.issue.*
import static com.atlassian.jira.workflow.TransitionOptions.Builder;
import com.atlassian.jira.issue.IssueManager;

MutableIssue issue = ComponentAccessor.getIssueManager().getIssueObject("PA-2000");
IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager();

for (IssueLink issueLink in issueLinkManager.getInwardLinks( {

MutableIssue linkedIssue = (MutableIssue) issueLink.getSourceObject();
if ( == "blocks" && linkedIssue.getProjectObject().getKey().contains("OSP") && linkedIssue.getStatus().getName().contains("In Research")){
log.warn("OK ")
if (linkedIssue.getIssueType().getName() != "Epic"){
log.warn("IS NOT EPIC")
IssueInputParameters issueInputParameters = ComponentAccessor.getIssueService().newIssueInputParameters();
com.atlassian.jira.workflow.TransitionOptions trasitionOptions = new Builder().skipPermissions().skipValidators().setAutomaticTransition().skipConditions().build();
IssueService issueService = ComponentAccessor.getIssueService();
int actionId = 921;
IssueService.TransitionValidationResult transitionValidationResult = issueService.validateTransition(issue.getReporterUser(), linkedIssue.getId(), actionId, issueInputParameters, trasitionOptions);
IssueService.IssueResult transitionResult

if (transitionValidationResult.isValid()) {

transitionResult = issueService.transition(issue.getReporterUser(), transitionValidationResult);

}else if (!transitionValidationResult.isValid()) {

log.error("ERROR: " + transitionValidationResult.getErrorCollection());

2 answers

1 accepted

0 votes
Answer accepted

 found the error.


for (IssueLink issueLink in issueLinkManager.getInwardLinks( {

MutableIssue linkedIssue = (MutableIssue) issueLink.getSourceObject();


for (IssueLink issueLink in issueLinkManager.getOutwardLinks( {

MutableIssue linkedIssue = (MutableIssue) issueLink.getDestinationObject();
0 votes
Danyal Iqbal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2018

What is the issue link type id of both issues? Are they both blocing the source issue? You are only checking inwards links. That might be the issue.

check outward links from PA-2000 e.g

            List<IssueLink> allOutIssueLink = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId());

            for (Iterator<IssueLink> outIterator = allOutIssueLink.iterator(); outIterator.hasNext();) {
                IssueLink issueLink = (IssueLink);
                String key = issueLink.getDestinationObject().getKey();
               log.warn("linked issued:: "+key)



Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events