Automatically move unresolved issues to next sprint and update story points
Problem
You need to automatically move unresolved issues from a closed sprint to the next active sprint and update their story points based on remaining estimates.
Solution
Create a SIL script that automatically moves unresolved issues between sprints and recalculates story points based on remaining estimates. The script finds the last closed sprint, identifies unclosed issues, and moves them to either the current started sprint or the next available sprint while updating story points proportionally.
Script
string message="";
string brd=getElement(argv, 0);
number lastClosedSprint=0;
number nextSprintInSprints=-1;
string unclosedIssues="";
string[] closedIssuesInClosedSprint;
if (isNull(brd))
{
message = "Missing parameter: Board name.";
return message;
}
lastClosedSprint=getElement(closedSprints(brd),size(closedSprints(brd))-1);
if (size(notStartedSprints(brd))>0)
{
nextSprintInSprints=getElement(notStartedSprints(brd), 0);
}
closedIssuesInClosedSprint=selectIssues("sprint = " + lastClosedSprint + " AND status = 'Closed'");
for (string iss in closedIssuesInClosedSprint)
{
removeIssueFromSprint(iss, lastClosedSprint);
if (isNotNull(startedSprints(brd)))
{
addIssueToSprint(iss, getElement(startedSprints(brd),0));
}
else
{
if (nextSprintInSprints>-1)
{
addIssueToSprint(iss, nextSprintInSprints);
}
}
if (isNotNull(%iss%.originalEstimate) and originalEstimate!=0 and isNotNull(%iss%.estimate))
{
interval originalInterval=%iss%.originalEstimate;
interval remainingInterval=%iss%.estimate;
number points =#{%iss%.Story Points};
number originalMillies = originalInterval["TOMILLIS"];
number remainingMillis = remainingInterval["TOMILLIS"];
number newPoints=round(points * remainingMillis / originalMillies, 0);
#{%iss%.Story Points}=newPoints;
}
unclosedIssues = unclosedIssues + ", " + iss;
}
if (startsWith(unclosedIssues, ", ") )
{
unclosedIssues=substring(unclosedIssues, 2, -1);
}
message = "Unclosed issues " + unclosedIssues + " were removed from Sprint " + lastClosedSprint + " and added to Sprint " + nextSprintInSprints + ".";
message = message + "Story points have been updated.";
return message;Implementation steps
Step 1: Create the SIL script file: |
|
|---|---|
Step 2: Configure the SIL Runner gadget |
For detailed configuration steps, see SIL Runner Gadget configuration. |
Example usage
To run this script:
Access the SIL Scripts Gadget on your dashboard.
Select your script from the programs dropdown.
Enter the board name as a parameter (for example,
SCRUM Board).Click Run.
The script automatically moves unclosed issues from the last closed sprint to the current active sprint (if available) or the next planned sprint, while recalculating story points based on remaining estimates.
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.
