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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.