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.

To automate state change from Scheduled to Implement

Arun33
Tera Expert

Hi,

 

I want a change request to move automatically from Scheduled to Implement state, at the planned start date/time.

 

I have created a Flow to change from Scheduled to Implement state, at the planned start date/time. but in flow

Wait For Condition if not working:

Arun33_0-1665770355770.png

 

Arun33_2-1665770422994.png

Arun33_4-1665770444040.png

In Wait For Condition I have used script in condition.

 

var start_date = fd_data.trigger.current.start_date;
var on_hold = fd_data.trigger.current.on_hold;
if (start_date == gs.nowDateTime() && on_hold == 'false') {
return true;
}
But this if condition is not working as expected. This if condition should be executed when planned start date/time is equal to system date/time 
 
can anyone help me on this

 

 

 

1 ACCEPTED SOLUTION

Mike_R
Kilo Patron
Kilo Patron

Try using the wait for duration of time Flow Logic

 

Mike_R_0-1665771386608.png

 

View solution in original post

14 REPLIES 14

What will be the trigger condition ?

Same trigger condition you had.

Just instead of the wait for condition action, use this one instead

Mike_R_0-1665772287331.png

 

HarshitaB
Tera Contributor

Hi Mike,

 

This solution works, however, if there is a modification to start date, flow keeps waiting for the initial date given instead of taking new value. How can we fix this issue.

This will work but i need if some change pass the planned start date/time then this flow should not execute.

 

maybe add to your trigger condition?

Or a parallel wait for condition and abort the flow when it meets those conditions.