- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
08-18-2022 03:18 AM
Hello,
A list of URLs splitted by "," is used in automation. The automation should create a new incident for each value, however it shouldn't be created in a sequential way. All incidents should be created at the same time (don't need to finish the first incident to get the next one).
08-18-2022 03:46 AM
Hey @Josep,
What exactly isn't working with creating the incidents? Do you mean the script waits for the first incident to finish its' playbook before creating the second one, and so on?
Here's an example of a short script, which would create all incidents without waiting for each one of them to finish:
inputs = demisto.executeCommand("getList", {"listName":<list_name>})[0]["Contents"]
inputList = list(inputs.split(","))
for item in inputList:
demisto.executeCommand("createNewIncident", {"name":item})
(replace {"name":item} with whatever you need the parameters of the new incidents to be)
08-18-2022 03:46 AM
Hey @Josep,
What exactly isn't working with creating the incidents? Do you mean the script waits for the first incident to finish its' playbook before creating the second one, and so on?
Here's an example of a short script, which would create all incidents without waiting for each one of them to finish:
inputs = demisto.executeCommand("getList", {"listName":<list_name>})[0]["Contents"]
inputList = list(inputs.split(","))
for item in inputList:
demisto.executeCommand("createNewIncident", {"name":item})
(replace {"name":item} with whatever you need the parameters of the new incidents to be)
08-18-2022 03:50 AM
Just solved, createNewIncident can be used in a loop and inputs can be set for each iteration. Incidents don't need to be solved to create the next one.
08-18-2022 03:52 AM
Thanks for the reply, other inputs can be set too.
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!