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.
Able to fetch the sprint details which are having only closed issues for the given date(sprint details and issues under it) but getting other sprint details as well with no issues for the below code
Can someone help me to modify this code to skip the unwanted sprints which do not have the issues and print only the sprints based on the conditions
string format = "MM/dd/yyyy"; //format for date
string creationdate = currentDate()-"90d";
runnerLog("creation date: " + creationdate);
for(JSprint sprint in getAllOpenSprints()) {
if (sprint.startDate < creationdate && sprint.state =="ACTIVE") {
string [] keys =selectIssues("Sprint = '" +sprint.name+ "'");
Boolean allClosed =true;
for(string key in keys) {
if(key.status!="Closed"){
all closed=false;
break;
}
}
if(allClosed){
runnerLog("Sprint name: " + sprint.name);
runnerLog("Sprint id: " + sprint.id);
runnerLog("Sprint start date: " +formatDate(sprint.startDate, format));
runnerLog("Sprint state: " +sprint.state);
runnerLog(keys);
updateSprint(sprint.id, sprint.name, "Closed" );
runnerLog("Sprint was updated: " + sprint.name );
}
}
}
string format = "MM/dd/yyyy"; //format for date
string creationdate = currentDate()-"90d";
runnerLog("creation date: " + creationdate);
for(JSprint sprint in getAllOpenSprints()) {
if (sprint.startDate < creationdate && sprint.state =="ACTIVE") {
string [] keys =selectIssues("Sprint = '" +sprint.name+ "'");
if(length(key)==0){
continue;
}
Boolean allClosed =true;
for(string key in keys) {
if(key.status!="Closed"){
all closed=false;
break;
}
}
if(allClosed){
runnerLog("Sprint name: " + sprint.name);
runnerLog("Sprint id: " + sprint.id);
runnerLog("Sprint start date: " +formatDate(sprint.startDate, format));
runnerLog("Sprint state: " +sprint.state);
runnerLog(keys);
updateSprint(sprint.id, sprint.name, "Closed" );
runnerLog("Sprint was updated: " + sprint.name );
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.