How to stop flow designer from business rule

Saloni9
Giga Contributor

Hi,

I want to stop flow designer from the Business rule. We have a requirement to copy the state of SCTASK on the RITM. In some catalog items there are more than 1 SCTASKs. I write the below business rule on after , state changes to closed incomplete or state changes to closed skipped

var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
//gr.addQuery('sys_id', current.parent);
gr.state = current.state;
gr.stage = 'Request Cancelled';
//gr.setWorkflow(false);
gr.update();

But because of OOTB br(cancel flow on request cancelled) all the sctasks are changing to closed Incomplete. 

Please help in this.

 

Many thanks!!

Saloni

15 REPLIES 15

Saloni9
Giga Contributor

@Ankur Bawiskar I guess we need to go each flow designer and change the condition as when sctask is closed incomplete update the req as closed incomplete.

@Saloni 

You can either update the flow trigger condition

OR

Let the flow trigger the context; you cancel it with the script I shared above.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Yes @Ankur Bawiskar I will try that script

@Saloni 

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

I have similar kind of requirement. Need to create business rule to close RITM and REQ when the first task in RITM is closed rejected. Please assist.