Wait for condition in workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:16 AM - edited 08-07-2023 12:19 AM
Hi,
I need to add wait for condition activity in workflow
There is a run script activity which is creating a ritm(kick off other catalog item), once that ritm state gets closed complete then it should move to next activity
When the ritm state gets closed complete then only it should move to next activity, untill then it should wait
How can we achieve this functionality
Can someone help me here
Thanks in advance 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:29 AM
Hello @anvitha ash
You can add Wait for Condition, In it you can select state field , state is closed complete, after that add your task that you wanna execute.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:40 AM
Hello @Samaksh Wani ,
Thanks for sharing your response
I have written the script but it's not working as expected
//Script written in "Wait for condition" activity
var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery("request=" + workflow.scratchpad.request);
gr.query();
if(gr.next()){
if (gr.state == '3' || gr.state == '4' || gr.state == '7'){
answer = true;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:32 AM
In the workflow you can use the activity 'Wait for Condition'' which will let you wait for the completion of RITM Until its closed complete, you can also consider using flow designer ''wait for condition'' for the same.
I hope this helps !
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:39 AM
Hi @Sohail Khilji ,,
Thanks for sharing your response
//Script written in "Wait for condition" activity
var gr = new GlideRecord('sc_req_item');
gr.addEncodedQuery("request=" + workflow.scratchpad.request);
gr.query();
if(gr.next()){
if (gr.state == '3' || gr.state == '4' || gr.state == '7'){
answer = true;
}
}
I have this script but it's not working