- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 06:49 AM
Community,
My current workflow is set to generate tasks 30 days after request is submitted. The customer is now allowing users to select extended days beyond the automatic 30 days. I am not sure how to update the workflow timer to include the extended days variable. Any assistance will be helpful.
var endTimeValue = current.variables.idServerPoweredDown; //new variable for users to extend x days beyond 30 automic days.
var now = gs.nowNoTZ();
var endTime = new GlideDateTime(now);
endTime.addDaysLocalTime(30);
var diff = gs.dateDiff(now, endTime, true);
answer = diff;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 06:55 AM
If endTimeValue is number of days then simply this should work
var endTimeValue = current.variables.idServerPoweredDown; //new variable for users to extend x days beyond 30 automic days.
var now = gs.nowNoTZ();
var endTime = new GlideDateTime(now);
endTime.addDaysLocalTime(30 + endTimeValue);
var diff = gs.dateDiff(now, endTime, true);
answer = diff;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 06:55 AM
If endTimeValue is number of days then simply this should work
var endTimeValue = current.variables.idServerPoweredDown; //new variable for users to extend x days beyond 30 automic days.
var now = gs.nowNoTZ();
var endTime = new GlideDateTime(now);
endTime.addDaysLocalTime(30 + endTimeValue);
var diff = gs.dateDiff(now, endTime, true);
answer = diff;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 02:49 PM
Anurag thank you. I just added this to my workflow and will do a test to see what happens tomorrow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 10:32 AM
Thank you Anurag, my testing was successful.