Setting a Date Time in the Resolved field using Workflow

wilson8
Kilo Contributor

Hi, I am a relative newbie to this so we are trying to set a value of the resolved date of an incident by workflow along with some other textual values for resolution information etc.

In workflow editor we go to the set value screen and use the drop down to select the Resolved field where we have entered the expression "javascript:gs.nowDateTime()". I have just been checking on some incidents and it appears not be working consistently if at all. The workflow has run and got beyond this action (usually then to terminate).


I have trawled the wiki but found nothing to confirm or otherwise that this is the correct or best way of doing this I would appreciate any advice.

Many thanks in advance..

1 ACCEPTED SOLUTION

Hi Wilson,



You can use 'Set Values' activity in your workflow to set all the values.


Example-


In the 'Set Values' activity in your workflow you can use below-


Set -


Resolved - javascript:gs.nowDateTime()


Resolved By - javascript:gs.getUserID()


and so on.



Thanks,


Tanaji


View solution in original post

13 REPLIES 13

The link Michael shared talks about 'current.update()' used in the workflow script activities like run script activity.



As 'Set Values' is a workflow activity it is handled by the workflow engine. And hence


Resolved - javascript:gs.nowDateTime()


Resolved By - javascript:gs.getUserID()


will be executed by the workflow engine and not any other engine. So the issues mentioned in the link should not happen here.



So you don't need to worry here.


You can go ahead with this.


wilson8
Kilo Contributor

Brilliant, thank you.


I think we can consider the issue closed now, thanks all for your input.


Great


Can we close this marking the helpful/correct answers using the buttons provided with the responses?


Hi Wilson,



Using Set Values should be fine. Using current.update() in the code is what I was trying to say you should avoid. I hope your new code works for you.



Thanks,


Michael