Stories rolled to next sprint

CV1
Tera Contributor

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:

find_real_file.png

 

  1. Here 1 entry is when the story was moved to next sprint (story was created and in draft state not assigned).
  2. second entry is when it was assigned and the story is going trough various states (WIP,Testing...) and the sprint changed.
  3. 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

 

4 REPLIES 4

Kieran Anson
Kilo Patron

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

CV1
Tera Contributor

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!

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?

CV1
Tera Contributor

Hi ,

I ended up doing some thing as below to address the requirement. But for reporting , I need other fields like start, end, duration that I am unable to fetch.

Please advise.

find_real_file.png