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!


ComponentAccessor.getIssueLinkManager does not return correct counts


Dear all,

I have a wierd issue in by getting the list of related linked to issue.

If I create an issue with 2 relates to linked issue, the following code returns correctly the 2 related issue using

def links =ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId())

return links.size() => return 2 = OK

If then I add a new relates to issue to same parent issue and run the code again,  it is still returning 2 instead of 3.

Any idea what is wrong ?


Here is my all custom scripted field code


import com.atlassian.jira.component.ComponentAccessor
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()

if ( == "Service Request") {

def links = ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId())

//def links = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())

def BudgetField =customFieldManager.getCustomFieldObjects().findByName("Budget Number")
def CurrencyField =customFieldManager.getCustomFieldObjects().findByName("Currency")
def CurencyValue=issue.getCustomFieldValue(CurrencyField)

//return links[0].getSourceObject()

double Budget=0
for( l in links) {

//use this for Outward links
// output = output + l.getSourceObject() + "<br/>"
if (l.getSourceObject().getCustomFieldValue(BudgetField) != null){
double val= l.getSourceObject().getCustomFieldValue(BudgetField)

Budget=Budget + val

//use this for Inward links
// output = output + + ": " + l.getSourceObject() + "<br/>"


return (Budget + " $CurencyValue")





1 answer

1 accepted

0 votes
Answer accepted

I found out the reason.

The problem was comming from the fact that Jira gets by default same value for InWard and Outward link for Relates entry, which is quite non sense as direction is really important


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events