It's all about the answers!

Ask a question

Assign actual start date value systematically

Amit Girme (1132027) | asked Feb 09 '13, 6:24 a.m.
edited Apr 02 '13, 4:32 a.m. by Ralph Schoon (63.3k33646)
 Hi All,

I have created "Actual Start date" attribute of Type string for WI. The moment i move from 'New' state to               'In progress' state 'Actual Start date' field should take date systematically.

 i have written a script which takes date along with time but i want only Date to be displayed.

Also when 'In Progress' State i have make any further changes in WI and save then the field takes current time.

Following is the script which i have written


(function() { 
    var WorkItemAttributes =; 
    dojo.declare("currentInProgressDate", null, { 
        getValue: function(attribute, workItem, configuration) { 
            var now = new Date();

            var stat = workItem.getValue(WorkItemAttributes.STATE); 
if(stat === "")
                       return now; 
}) ();

Eric Jodet commented Feb 11 '13, 12:46 a.m.

Hello Amit,
not sure what is the question / expectation here.


Amit Girme commented Feb 11 '13, 3:33 a.m. | edited Feb 11 '13, 6:42 p.m.

Thanks everyone for your suggestions.

The issue has been solved.
 My script was not taking the state value in the variable and now field is fetching date properly.

One answer

permanent link
Ralph Schoon (63.3k33646) | answered Feb 11 '13, 2:57 a.m.
Hi, As Eric, I can only guess what the question is - or if this is a statement.

Please note, timestamp attributes are currently date and time of date. See for an enhancement.

If you are using a string attribute, you could probably look into and how timestamps are handled. You could try to print only the date there. 

Please be aware, that Javascript has issues with detecting state changes. You need to make the script dependent only on the state attribute, this way the script is only triggered if the state is set. If you have more dependencies, you can't tell anymore. I would personally rather use a participant (see because I can actually distinguish the state transitions there. See lab 5 for more hints on Javascript.


Your answer

Register or 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.