- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
05-24-2023 07:11 AM
Hi all,
I have a multi-tenant deployment. I want to run a script or playbook from one tenant to another tenant. How can I do this?
#XSOAR
05-26-2023 12:16 AM
You can use different API endpints. Please see the below example, which will retrieve the incidents under the tenant customer1. You can change the query according to your needs.
query="account:customer1"
body = {
"filter":{
"page":0,"size":200,"query":query,
"period":{"byFrom":"days","fromValue":7,"byTo":"days"}
}
}
incidents = demisto.executeCommand("demisto-api-post", {'uri': f"/incidents/search/", 'body': body})[0]["Contents"]["response"]["data"]
demisto.results(incidents)
05-30-2023 02:23 AM
Hi Gyldz,
Thank for your reply.
I didn't want to run script on an existing incident. My bad, I didn't specify that. For this, I first created an incident and assigned a default playbook to the incident. This way I can run the script I want.
demisto-api-post uri = /tenant_name/incident and
body;
https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR-API/Create-single-incident
05-24-2023 07:57 AM
Hi, what kind of script do you want to run? You can make use of API calls for this purpose.
05-25-2023 06:01 AM
Yes, actually I want to run an automation script in XSOAR via API.
05-26-2023 12:16 AM
You can use different API endpints. Please see the below example, which will retrieve the incidents under the tenant customer1. You can change the query according to your needs.
query="account:customer1"
body = {
"filter":{
"page":0,"size":200,"query":query,
"period":{"byFrom":"days","fromValue":7,"byTo":"days"}
}
}
incidents = demisto.executeCommand("demisto-api-post", {'uri': f"/incidents/search/", 'body': body})[0]["Contents"]["response"]["data"]
demisto.results(incidents)
05-30-2023 02:23 AM
Hi Gyldz,
Thank for your reply.
I didn't want to run script on an existing incident. My bad, I didn't specify that. For this, I first created an incident and assigned a default playbook to the incident. This way I can run the script I want.
demisto-api-post uri = /tenant_name/incident and
body;
https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR-API/Create-single-incident
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!