Name
global.BurnDownRequest
Description
This utility provides request object for the burn down processors
Script
var BurnDownRequest = Class.create();
BurnDownRequest.prototype = {
TASK:'task',
PROJECT: 'pm_project',
PROJECT_TASK: 'pm_project_task',
RELEASE_VIEW: 'RELEASE',
RELEASE_TABLE: 'rm_release_scrum',
RELEASE_METRIC: 'RM Release Total Story Count',
RELEASE_REFERENCE: 'release',
RELEASE_SPRINT_TABLE: 'rm_sprint',
SPRINT_VIEW: 'SPRINT',
SPRINT_TABLE: 'rm_sprint',
SPRINT_METRIC: 'RM Sprint Total Story Count',
SPRINT_REFERENCE: 'sprint',
PROJECT_VIEW: 'PROJECT',
PROJECT_TABLE: 'pm_project',
PROJECT_METRIC: 'RM Project Total Story Count',
PROJECT_REFERENCE: 'project',
PROJECT_SPRINT_TABLE: 'rm_sprint',
initialize: function ( requestParams) {
this.view = requestParams.getParameter('view');
this.view = this.view.toUpperCase();
this.sysId = requestParams.getParameter('record_sys_id');
this.metricId = this.sysId;
this.excludeWeekend = requestParams.getParameter('exclude_weekend');
this.excludeHardening = requestParams.getParameter('exclude_sprint');
if( this.view == 'SPRINT') {
this.metricDefinition = this.SPRINT_METRIC;
this.referenceField = this.SPRINT_REFERENCE;
this.table = this.SPRINT_TABLE;
}
if( this.view == 'RELEASE') {
this.metricDefinition = this.RELEASE_METRIC;
this.referenceField = this.RELEASE_REFERENCE;
this.table = this.RELEASE_TABLE;
}
if( this.view == 'PROJECT') {
this.metricDefinition = this.PROJECT_METRIC;
this.referenceField = this.PROJECT_REFERENCE;
this.table = this.PROJECT;
}
if( this.view == 'PROJECT_TASK') {
this.table = this.PROJECT_TASK;
}
},
getGlideRecord: function(){
var gr = new GlideRecord(this.TASK);
gr.get(this.sysId);
return gr;
},
isValid: function() {
if( this.view && this.sysId ) {
var gr = this.getGlideRecord();
if( gr.getValue('short_description')) {
return true;
}
else {
return false;
}
}
return false;
},
type: 'BurnDownRequest'
};
Sys ID
0c45d3c89f122100598a5bb0657fcfd2