- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
02-21-2024 01:14 AM
Hello all,
I need to reopen a large amount of incidents on Xsoar. Can anyone suggest how I can do this?
I have tried to run both the built-in command and the automation to reopen from the run command button with the bulk incidents selected but to no avail.
Many thanks,
MR
02-21-2024 08:32 AM
Hi,
There are couple of ways you can do this:
Here is an example script to this by query:
queryid = demisto.getArg("query")
if "status:closed" not in queryid.lower():
queryid += " and status:Closed"
incs = demisto.executeCommand("getIncidents", {"query":queryid})[0]['Contents']
if incs['total'] == 0:
demisto.results("Could not find incidents, please confirm query")
sys.exit()
listreopen = [i['investigationId'] for i in incs['data']]
for incid in listreopen:
demisto.executeCommand("reopenInvestigation", {"id":incid})
strlist = ",".join(listreopen)
totalcount = len(listreopen)
demisto.results(f"Done, reopened {totalcount} incidents: {strlist}")
Hope this helps!
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!