Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Due date and time in manager approval task

surajsukuma
Tera Contributor

Hello,

 

I am looking option to add Due date & Time for Manager approval task. Anyone can suggest?

 

I Need two options

1st if manager is not approved in 5days from request date 

2nd If manager is not approved in 2hrs from Request date time. 

 

surajsukuma_0-1721992864292.png

 

1 ACCEPTED SOLUTION

Hi @surajsukuma ,

 

If you want to add the due date +2 hours from created, try the below script

 

 

var created_date = fd_data.trigger.current.sys_created_on;
created_date.addSeconds(7200);
return created_date;

 

 

Regards,

Dhanraj.

 

View solution in original post

3 REPLIES 3

Mark Manders
Mega Patron

Can you elaborate? You want to add fields or you need logic? 

Next to that: what kind of weird request is it to do something within 2 hours related to approval? 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

I need to add due time for approval task, If 1st Manager is not approved with in 2hr from request creation date, need to go to second level manager. i tried below option didnt work

 

var now = new GlideDateTime();
return gs.hourAgo(-2);

Hi @surajsukuma ,

 

If you want to add the due date +2 hours from created, try the below script

 

 

var created_date = fd_data.trigger.current.sys_created_on;
created_date.addSeconds(7200);
return created_date;

 

 

Regards,

Dhanraj.