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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

Need help with Scriptrunner script for working on ONLY one type of issue linking

Edited

I use the below script to capture the dates of the Epic Due Date and display the farthest date at the Program Epic Due Date field (scripted field). If any of the Due Date in the Epic is empty, then the scripted field at the Program Epic returns empty.

The script is working fine, but considers ALL of the epics associated with the Program Epic. Can you please help me modify the script so that ONLY the child of the Program Epic is considered and no other links.

 

import com.atlassian.jira.issue.link.IssueLink;
import com.atlassian.jira.component.ComponentAccessor;
import java.sql.Timestamp

def allOutIssueLink = new ArrayList<IssueLink>(ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId()))
def issueLinks = allOutIssueLink?.findAll() {it.getDestinationObject().getIssueType().getName() == "Epic"}
def farthestDate


for(IssueLink issueLink : issueLinks){
def dueDate = issueLink.getDestinationObject().getDueDate()
if (dueDate == null){
return null
}
else if (farthestDate == null){
farthestDate = dueDate
}
else if (dueDate?.after(farthestDate)){
farthestDate = dueDate
}
}

def allInIssueLink = new ArrayList<IssueLink>(ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId()));
issueLinks = allInIssueLink?.findAll() {it.getSourceObject().getIssueType().getName() == "Epic"}

for(IssueLink issueLink : issueLinks){
def dueDate = issueLink.getSourceObject().getDueDate()

if (dueDate == null){
return null
}
else if (farthestDate == null){
farthestDate = dueDate
}
else if (dueDate?.after(farthestDate)){
farthestDate = dueDate
}
}

return farthestDate

 

 

1 answer

Suggest an answer

Log in or Sign up to answer

@Ravi Sagar _Sparxsys_  Hi Sir, Can you please help me with the Scriptrunner script.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events