automatically status flipping in RTC 5.0.2 from resolved to closed
How can i Flip the status of workitem from 'Resolved' to 'Closed' automatically after 48 hours.
i can see that we can write our own condition in Dojo. So itried one but i am not sure how that is going to work.
1: Shall i create a dummy types and attribute and set that as to take calculated data.
2: How can i compile my code in RTC to check if it there is any error and if so then what error.
3: please review my first piece of code written in Dojo to achieve this.
dojo.provide("com.CalHEERS.ResolvedToClosed");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date");
dojo.require("dojo.date.stamp");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.CalHEERS.ResolvedToClosed", null, {
getValue: function(attribute, workItem, configuration) {
var currentDate = new Date();
var currentDateString = dojo.date.stamp.toISOString(currentDate, {milliseconds:true, zulu:true});
var resolutionDate = dojo.date.stamp.fromISOString(workItem.getValue(com.ibm.team.workitem.attribute.resolutiondate));
var SRStatus = workItem.getValue(com.ibm.team.workitem.attribute.state);
If (((SRStatus == "Resolved") || (SRStatus == "SR.action.a7")) && (currentDateSting.getTime() - resolutionDate.getTime() >= 2))
{
SRStatus = "Closed";
}
else
{
SRStatus = "Resolved"
}
}
})
})();
So please on the same.
Regards,
Aruna.K