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.