Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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


 

0 votes

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



One answer

Permanent link
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 + "'")
      
       
    }
});
})();

0 votes

Comments

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

        if ( ReviewStatus == "NewDefectWorkflow.state.s2" )
        {

            return ModifiedDateString;
        }

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Sep 07 '16, 5:50 a.m.

Question was seen: 1,581 times

Last updated: Sep 07 '16, 7:26 a.m.

Confirmation Cancel Confirm