Wait for Condition in Flow not waiting long enough?

Jason_DaSilva
Tera Guru

I have looked up a few similar posts, and it appears that when you use the Ask For Approval action, it should wait for the approval before continuing.  Well, I have that in place and the conditions are either 1 approves or 1 rejects.  After that I run a custom action script that needs to reference the RITMs approval field.  
Things were not firing correctly, so I logged the value of this field in the script action and it was coming back as 'requested' instead of as 'approved' or 'rejected'.  So I took this one step further and added a wait for condition that the RITM is either approved or rejected.  Still I am getting the approval field returned as requested.  This is very odd because last week, this code worked fine.

I know the code works cause if I fudge the value of the approval field to be either approved or rejected the script works fine...


Some kind of timing issue?

1 ACCEPTED SOLUTION

Jason_DaSilva
Tera Guru

Will still wait to see if anyone has a response to this.  As a work around, instead of using the ticket.approval value, I instead added a manual string input for the action script which is based off an if statement in the flow after the Ask for Approval and the Condition.  If the approval state is approved, I pass an 'approved' string value, else I pass 'rejected'.  These would be the values of the ticket.approval if it processed in time, which I think is the issue.  Still not sure how it gets past the condition if the RITM approval value is neither 'approved' or 'rejected'...

View solution in original post

2 REPLIES 2

Jason_DaSilva
Tera Guru

Quick update to this.  It started to work and then just as suddenly it stopped working.  The only change I made was to remove a commented out log line from the Action.  I am confused as to why this works 'sometimes'...

I do not understand how it can get past the Ask For Approval action and then a Wait for Condition where the condition is that the RITM's approval field is either 'approved' or 'rejected' and still have the value that was just previously tested for as 'requested'.  

 

Jason_DaSilva
Tera Guru

Will still wait to see if anyone has a response to this.  As a work around, instead of using the ticket.approval value, I instead added a manual string input for the action script which is based off an if statement in the flow after the Ask for Approval and the Condition.  If the approval state is approved, I pass an 'approved' string value, else I pass 'rejected'.  These would be the values of the ticket.approval if it processed in time, which I think is the issue.  Still not sure how it gets past the condition if the RITM approval value is neither 'approved' or 'rejected'...