I want to change the time in relative duration time as 2 min from now

rajeshKongamudi
Tera Contributor

Hi Community,

 

Here we are triggering notification if the approver was not accepted for 2 business days using workflow here we want for testing purpose we need to change this to wait for only 2 min from now. can you please help us on this how to change this relative duration as 2 min from now. Thanks in advance.

 

1) Here is the workflow

rajeshKongamudi_0-1690291030465.png

 

2) This is what they are doing in timer activity they are calling relative duration 

rajeshKongamudi_1-1690291104665.png

 

3) This is the relative duration time they are using how can we change this to wait 2 min from now

rajeshKongamudi_2-1690291147960.png

 

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, this section of the code adds 1 day to the default 2 days if the start time is after 10 am.

if (calculator.isAfter(calculator.startDateTime, "10:00:00")) {
   days++;
}
calcRelativeDueDate() adds the resulting days and I do not believe that it will deliver your requirement to add minutes.

DurationCalculator | ServiceNow Developers

 

If this is for testing then I would just bypass the activity or replace/update it with a standard wait x minutes.
But this would only be for testing, and I would not recommend deploying small value timers to prod.