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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,889
Community Members
 
Community Events
185
Community Groups

Get the sprints which are having only closed issues based on the sprint start date

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 );
}
}

}

1 answer

1 accepted

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 );

}

}

}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events