IBM QRadar SOAR

 View Only

 closing incidents returned by query_builder

Jay Rayq's profile image
Jay Rayq posted Fri March 07, 2025 11:55 AM

I am new to the SOAR platform.


I want to fetch all active incidents and close the first one as part of a larger automation project.

I used query_builder to fetch all incidents.

Attempting to close the returned incident throws error showing TypeError :query_builder results are read only.
(1) Is there a way I can use to close the incident returned in the script?
(2) Running the script requires incident ID, is it possible to supply the incident ID from the incident returned from query_builder ?

query_builder.notEquals(fields.incident.plan_status, "C")
query = query_builder.build()
active_incidents_count = helper.getIncidentsCount(query)

all_active_incidents = helper.findIncidents(query)

incident_to_close=all_active_incidents[0]

incident_to_close.plan_status="C"

Mohamad islam Hamadieh's profile image
Mohamad islam Hamadieh

Hi I remember this not being possible if you are just using a script. I even asked for it in one of the ideas.

Set top-level Incident from with an Incident script. | IBM QRadar SOAR

you can vote for the idea here 

IBM Ideas

alternatively you can use the incident modification api with the query builder script in a playbook.