Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Manually closing a case and terminating open playbook

Kit G
Giga Guru

Hi all,

 

Looking for some advice on handling manual case closure and playbook termination.

 

Scenario

Currently we have a custom case which has an associated playbook that triggers on creation. The playbook when completed successfully closes out the case and all is well. However if a agent sets the case to a resolution of cancelled for example the playbook remains active and the case remains in an open state.

 

Questions

  1. What are the best practice methods for controlling manual case closure?

Thanks in advance

1 ACCEPTED SOLUTION

Hi @Lisa Holenstein ,

We ended up using a business rule and scripting to resolve this issue which was fairly straight forward. Understanding not all playbook users may be familiar with scripting it. Thanks again for your input 😄

Sample

 

sn_playbook.PlaybookExperience.cancelPlaybooksByParentRecord(current, "XYZ is cancelled");

 

 

Doco

PlaybookExperience | ServiceNow Developers

 

Cheers

Kit

 

View solution in original post

5 REPLIES 5

Kit G
Giga Guru

hey @Lisa Holenstein ,

would love it if I could get some advice from an experienced playbooker 😄

 

Cheers

Kit

Lisa Holenstein
ServiceNow Employee
ServiceNow Employee

Hi Kit,

we currently don't have a generalized activity to do something like the "End Flow" flow logic, but you can reuse or duplicate the functionality included in the Incident Management for Service Operations Workspace. There is a subflow/action that lets you end the playbooks for a given Parent Record with the corresponding PlaybookExperience API method cancelPlaybooksByParentRecord().

1. (Optionally) install the above plugin or create an action & subflow based on their "Cancel remedial action playbook" action & subflow.

2. In your playbook, create a parallel branch with a new stage.

3. In that stage, add a new activity Wait for Condition, with the condition of your parent record being closed or canceled.

4. Add a new activity and check the box to "Include all Automation Assets" to show subflows and actions, pick the Cancel remedial action playbook subflow and map the record input to your playbook parent record.

 

Hope this helps,

Lisa



Have questions about the Now Platform? Join our bi-weekly Platform Academy.

Hey @Lisa Holenstein ,

Thanks for the response, I will look into your suggestions and let you know the results 😄

 

Regards

Kit

Hi @Lisa Holenstein ,

We ended up using a business rule and scripting to resolve this issue which was fairly straight forward. Understanding not all playbook users may be familiar with scripting it. Thanks again for your input 😄

Sample

 

sn_playbook.PlaybookExperience.cancelPlaybooksByParentRecord(current, "XYZ is cancelled");

 

 

Doco

PlaybookExperience | ServiceNow Developers

 

Cheers

Kit