You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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 (issue.issueType.name == "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().issueType.name + "<br/>"
if (l.getSourceObject().getCustomFieldValue(BudgetField) != null){
double val= l.getSourceObject().getCustomFieldValue(BudgetField)
Budget=Budget + val
}
//use this for Inward links
// output = output + l.issueLinkType.name + ": " + l.getSourceObject() + "<br/>"
}
return (Budget + " $CurencyValue")
}
<==
regards
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
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.