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 |
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 + "'") } }); })(); Comments
sam detweiler
commented Sep 07 '16, 7:26 a.m.
the problem is that you cannot tell that this state is JUST being set or has been for a long time.. your code is causing the date change
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
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
Hi Dinesh,
Thanks for the Response.
Please review the script
Kind Regards,
Vijay
Hi Dinesh,
Thanks for the Response.
Please review the script
Kind Regards,
Vijay