setPlaybook + Post-Processing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

setPlaybook + Post-Processing

L1 Bithead

 

Hi everyone,

I have a Post-Processing script that uses the setPlaybook command to switch the incident to a playbook called test1.

 

The problem is that when I close the incident, the script doesn’t run just once - it keeps setting the same playbook repeatedly, and as a result the test1 playbook is triggered about 10 times in a row.

Here’s my code:

 

 
try:
# Run the test1 playbook
result = demisto.executeCommand("setPlaybook", {"name": "test1"})
return_results(True)
except Exception as e:
return_error(f"Error: {str(e)}")

My question is:
How can I make sure the playbook is set only once, and avoid it running multiple times during closing?

Thanks in advance!

0 REPLIES 0
  • 38 Views
  • 0 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!