- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 11:13 AM
Hello,
I have a workflow for a RITM that has a wait-for condition. The wait for condition is waiting for the user who the RITM is requested for to have their user record updated. If I manually update the user record and then go to the RITM and make any change the wait for condition works properly. I created a business rule that when the user record gets updated go to the RITM and make a change so that the wait for the condition will trigger without anyone needing to manually update the RITM. However, after adding the business rule and updating the user record I am getting a workflow terminated error message. Does anyone know how I can resolve this issue?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 01:29 PM
Hi Jared,
Since the workflow is on RITM table, it will only move forward in case there a manual change on the RITM, instead of updating the RITM with a business rule. Write an after business rule on the user table with the below logic.
runWorkflow_task();
function runWorkflow_task() {
var parentGr = new GlideRecord(sc_req_item);
parentGr.addQuery("requested_for", current.sys_id);
parentGr.query();
if (parentGr.next()) {
new Workflow().broadcastEventToCurrentsContexts(parentGr, 'update', null);
}
}
Hence whenever the user record is updated, the wait for condition will again trigger and check for the condition.
Let me know in case of any further queries.
Regards,
Deepankar Mathur

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2022 11:43 AM
Hi Jared,
I would suggest to open the script include and you can go through the function being written by Servicenow, which can provide you with more details and OOB functions that can be utilized.
Regards,
Deepankar Mathur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 12:06 PM
Hi Jared,
I would suggest you to use Set Values activity of Workflow after Wait for condition activity.
Hopefully this will give you a direction.
Regards,
Muhammad Khan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 12:40 PM
Do you mean I should use Set Value activity to update the RITM on the workflow after the Wait For Condition? If so, the reason I am updating the RITM with a Buisness Rule is because the Wait For Condition does not check to see if its condition is met until the RITM gets updated. At least, that is my understanding of the Wait For Condition.