- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2018 12:17 PM
We have a workflow on the Task table, creating a project/task with the parent on the prj an RITM. When the Proj Task closes, we need to force the w/flow to update for the wait for condition to continue.
I'm trying the business rule that I've found on the forum but I'm needing to query the RITM on the project.parent from the prj task table.
function forceWFupdate(){
var wf = new Workflow();
var pm = new GlideRecord('pm_request');
if (pm.get(current)) //or current.parent or current.change_request if you want it to update the parent's wf
wf.runFlows(pm,'update');
}
Here's a prj with the RITM as the parent. The prj task is closed but the wait for will not advance until we update the RITM.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2018 01:37 PM
On which table are you running the workflow?
you can write a BR on Project task table as below
forceWFupdate();
function forceWFupdate(){
var pm = new GlideRecord('pm_request');
if (pm.get(current.parent)) //or current.parent or current.change_request if you want it to update the parent's wf
{
pm.work_notes = current.number+' has been closed';
pm.update();
}
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(current.parent.parent)) //or current.parent or current.change_request if you want it to update the parent's wf
{
ritm.work_notes = current.number+' has been closed';
ritm.update();
}
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2018 01:37 PM
On which table are you running the workflow?
you can write a BR on Project task table as below
forceWFupdate();
function forceWFupdate(){
var pm = new GlideRecord('pm_request');
if (pm.get(current.parent)) //or current.parent or current.change_request if you want it to update the parent's wf
{
pm.work_notes = current.number+' has been closed';
pm.update();
}
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(current.parent.parent)) //or current.parent or current.change_request if you want it to update the parent's wf
{
ritm.work_notes = current.number+' has been closed';
ritm.update();
}
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2018 01:49 PM
Thank you Sanjivmeher, that worked...:)) Of course, I had a typo on the project table in my post, but I did have the correct table in the br..:)