Time stamp overwritting when i save the WI
Hi,
I request for your help or suggestion for the issue that i have seen in the RTC Perl scripts.
Action = Fixed
State = Fixed
I have a script which capture the Time stamp when the action "Fixed" is performed in Defect WI..
My question is..
Now the WI is in the "Fixed" state.
In the "Fixed" State i have changed some attribute value (Example: Team area or Owned by) and click on save then the Time stamp is overwriting which should not happen.
Please suggest me..
Kind Regards,
Vijay
I request for your help or suggestion for the issue that i have seen in the RTC Perl scripts.
Action = Fixed
State = Fixed
I have a script which capture the Time stamp when the action "Fixed" is performed in Defect WI..
My question is..
Now the WI is in the "Fixed" state.
In the "Fixed" State i have changed some attribute value (Example: Team area or Owned by) and click on save then the Time stamp is overwriting which should not happen.
Please suggest me..
Kind Regards,
Vijay
One answer
Hi Dinesh,
Thanks for your response..!
Please review the script.. your help will be appreciated.
dojo.provide("com.example.defectresolutiondateCalculationValueProvider");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date.stamp");
// --------------------------------------------------------------------------------
// the date to the current timestamp.
// --------------------------------------------------------------------------------
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.defectresolutiondateCalculationValueProvider", null, {
getValue: function(attributeId, workItem, configuration) {
// Log messages go to: Eclipse client: client/eclipse/workspace/.metadata/.log
console.log("com.example.dateCalculationValueProvider - Entry");
// Get the current timestamp, and convert it to an ISO-8601 string
var ModifiedDate = new Date();
console.log("Modified Date = " +ModifiedDate);
var ModifiedDateString= dojo.date.stamp.toISOString(ModifiedDate, {milliseconds:true, zulu:true});
console.log("Modified Date String = " +ModifiedDateString);
var ReviewStatus = workItem.getValue(WorkItemAttributes.STATE);
console.log("com.example.dateCalculationValueProvider: ReviewStatus: '" + ReviewStatus + "'");
// If the state is Fixed
if ( ReviewStatus == "NewDefectWorkflow.state.s2" )
{
return ModifiedDateString;
}
else
{
//var retestDate = dojo.date.stamp.toISOString(workItem.getValue("retesting_date"));
//console.log("current constraint date is "+retestDate);
console.log("set old date back");
return workItem.getValue(attributeId);
}
console.log("com.example.dateCalculationValueProvider - Exit: Review date returned is '" + ModifiedDateString + "'")
}
});
})();
Thanks for your response..!
Please review the script.. your help will be appreciated.
dojo.provide("com.example.defectresolutiondateCalculationValueProvider");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.date.stamp");
// --------------------------------------------------------------------------------
// the date to the current timestamp.
// --------------------------------------------------------------------------------
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.example.defectresolutiondateCalculationValueProvider", null, {
getValue: function(attributeId, workItem, configuration) {
// Log messages go to: Eclipse client: client/eclipse/workspace/.metadata/.log
console.log("com.example.dateCalculationValueProvider - Entry");
// Get the current timestamp, and convert it to an ISO-8601 string
var ModifiedDate = new Date();
console.log("Modified Date = " +ModifiedDate);
var ModifiedDateString= dojo.date.stamp.toISOString(ModifiedDate, {milliseconds:true, zulu:true});
console.log("Modified Date String = " +ModifiedDateString);
var ReviewStatus = workItem.getValue(WorkItemAttributes.STATE);
console.log("com.example.dateCalculationValueProvider: ReviewStatus: '" + ReviewStatus + "'");
// If the state is Fixed
if ( ReviewStatus == "NewDefectWorkflow.state.s2" )
{
return ModifiedDateString;
}
else
{
//var retestDate = dojo.date.stamp.toISOString(workItem.getValue("retesting_date"));
//console.log("current constraint date is "+retestDate);
console.log("set old date back");
return workItem.getValue(attributeId);
}
console.log("com.example.dateCalculationValueProvider - Exit: Review date returned is '" + ModifiedDateString + "'")
}
});
})();
Comments
Dinesh Kumar B
JAZZ DEVELOPER Sep 07 '16, 6:28 a.m.are you watching for the action "Fixed" or the state.. may be if you share the sample script, it would help assess if something is missing or it would behave the way it does.. thanks
Vijayveer Reddy
Sep 07 '16, 6:59 a.m.Hi Dinesh,
Thanks for the Response.
Please review the script
Kind Regards,
Vijay
Vijayveer Reddy
Sep 07 '16, 7:04 a.m.Hi Dinesh,
Thanks for the Response.
Please review the script
Kind Regards,
Vijay