Create individual incidents for each value in a list in parallel

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

Create individual incidents for each value in a list in parallel

L4 Transporter

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).

1 accepted solution

Accepted Solutions

L2 Linker

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)

View solution in original post

3 REPLIES 3

L2 Linker

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)

L4 Transporter

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.

Thanks for the reply, other inputs can be set too.

  • 1 accepted solution
  • 1961 Views
  • 3 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!