Create a task based on a date within a Catalog Item

rachelconstanti
Mega Sage

I have a Service Catalog item with a "start date" variable.

I need the workflow associated to the catalog item to create a task 4 days after that "start date".

I would prefer to do this via scripting (which is not an area of expertise).

Any out there able to help with a script?

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

try below

var gdt = new GlideDateTime(current.variables.start_date);
gdt.addDays(4);
answer = gs.dateDiff(gs.nowDateTime(), gdt + ' 07:00:00', true);

View solution in original post

17 REPLIES 17

Mike Patel
Tera Sage

try below

var gdt = new GlideDateTime(current.variables.start_date);
gdt.addDays(4);
answer = gs.dateDiff(gs.nowDateTime(), gdt + ' 07:00:00', true);

The timer did not error but it also did not "pause"...  

The task is still being created.

Thank you!

Using your suggestion I was able to get the timer to pause - if all goes to plan, the task I need should get created in 4 days!!!

 

Thank you again