Stories rolled to next sprint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2022 07:26 PM
Hi Everyone,
I have a requirement to report on stories rolled to next sprint.
What I have done:
Created Metric Definition : on Table: rm_story & Field:Sprint.
Observation: There are duplicate entries for the story collected.
For Eg:
- Here 1 entry is when the story was moved to next sprint (story was created and in draft state not assigned).
- second entry is when it was assigned and the story is going trough various states (WIP,Testing...) and the sprint changed.
- third entry the story state is complete and the sprint changed so it made an entry for this too.
I want the metric to check if the state is not in Draft or Complete or Cancelled and collect those records when sprint changes.
Please advise
TIA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2022 01:36 PM
Hi,
To do this, you will need to use a calculated metric definition and define a script:
(function(definition , current){
var currentState = current.getValue('state');
var stateNotIn = [BurnDownUtil.STORY_STATE_COMPLETE ,
BurnDownUtil.STORY_STATE_CANCELLED ,
BurnDownUtil.STORY_STATE_DRAFT];
if(stateNotIn.indexOf(currentState) == -1)
return;
var mi = new MetricInstance(definition , current);
var miGr = mi.getNewRecord();
miGr.field_value = true;
miGr.calculation_complete = true;
miGr.insert();
})(definition , current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2022 07:22 PM
Hi Kieran,
Thank you for the response. I tried as below and added a story to sprint that was in draft. Then moved the story to Ready ,WIP and changed the sprint. I do not see records collected when the sprint is changed. Please let me know what am I doing wrong. the attachments contain the metric definition and logs
TIA!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2022 02:00 AM
Hi CV,
Thanks for including the screenshots, super-helpful. If you modify your logs to show warnings and errors, do you see any regarding the script logic?
Can you gs.log the currentState value as well as the stateNotIn - just to ensure the values stored are correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2022 01:54 PM