Custom Playbook Behavior – Unable to Close Current Activity on Parent Case Closure

AkkiYen
Tera Expert

Hi Team,

 

I have developed a custom Playbook in PDI and aim to ensure that all Playbook activities are cancelled if they are in progress when the associated Parent Case record is either closed or cancelled. In such scenarios, all Playbook stages should also be cancelled. However, the current implementation cancels all stages and activities except the one currently in focus. I would like to know if there is a way to close this active activity as well, as illustrated in the screenshot and code provided below.
Note: I have already tried the OOB API, but it is also not working.
cancelPlaybooksByParentRecord(current);

 

CSM Workspace:

akashyenkur_1-1766393588010.png

 

BR:

akashyenkur_0-1766393288700.png

akashyenkur_2-1766393605902.png

 

Script Include:

akashyenkur_3-1766393652119.png

 

1 ACCEPTED SOLUTION

@AkkiYen 

there are internal records linked to that execution record which needs to be cancelled as well.

Did you check that link?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@AkkiYen 

there is an extra table involved if you wish to complete via script

check this link

Complete an activity via a script in the playbook 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi @Ankur Bawiskar, I saw in the backend that all the activities seem to be cancelled state, but on the CSM Workspace side, it still shows as In Progress. 

AkkiYen_0-1766401712403.png

 

@AkkiYen 

there are internal records linked to that execution record which needs to be cancelled as well.

Did you check that link?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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