IBM QRadar SOAR

IBM QRadar SOAR

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  This is how I close an incident using the REST API

    Posted Wed January 26, 2022 02:08 PM
    Just in case, someone needs, because it was not clear for me just inspecting the documentation.

    https://resilient.localdomain/rest/orgs/201/incidents/30246?return_dto=true

    {
    "changes": [
    {
    "field": {"name":"plan_status"},
    "old_value": {"text":"A"},
    "new_value": {"text":"C"}
    },
    {
    "field": {"name":"resolution_id"},
    "old_value": {"object":null},
    "new_value": {"object":10}
    },
    {
    "field": {"name":"resolution_summary"},
    "old_value": {"text":null},
    "new_value": {"text":"reason here"}
    }
    ]
    }

    ------------------------------
    []

    Leonardo Kenji Shikida
    ------------------------------


  • 2.  RE: This is how I close an incident using the REST API

    Posted Fri February 11, 2022 08:44 AM

    Hi Leonardo,

    Thanks for the example. The json payload is correct for the default 'on-close' defined fields. 'on-close' incident fields are customizable and may include custom incident fields as well. In that case, add them under "properties" hierarchy as:

    "properties": {
      "custom_field": "value"
    }



    ------------------------------
    Mark Scherfling
    ------------------------------



  • 3.  RE: This is how I close an incident using the REST API

    Posted Thu April 17, 2025 05:49 AM

    Hello Mark,

    I am trying to follow your instruction on the custom fields but I am facing a problem :

    The body :

    {
      "changes": [
        {
          "field": { "name": "plan_status" },
          "old_value": { "text": "A" },
          "new_value": { "text": "C" }
        },
        {
          "field": { "name": "resolution_id" },
          "old_value": { "object": null },
          "new_value": { "object": 10 }
        },
        {
          "field": { "name": "resolution_summary" },
          "old_value": { "text": null },
          "new_value": { "text": "Reason for closure" }
        }
      ],
      "properties": {
        "action": "test"

      }
    }

    The error i am getting: 

      "message": "Unable to process the supplied JSON. The field 'properties' is not recognized. The error occurred at line #19 and column #18.",

    Would it be possible to help ?



    ------------------------------
    abd el rahman Hamed
    ------------------------------



  • 4.  RE: This is how I close an incident using the REST API

    Posted Fri April 18, 2025 10:39 AM

    Hello,

    It seems like you are using the PATCH /orgs/{org_id}/incidents/{inc_id} REST API.

    The in-product REST API Reference shows that the expected input is a PatchDTO

    So your custom field isn't treated any differently than builtin fields.  Your JSON should look something like:
    {
      "changes": [
        {
          "field": { "name": "plan_status" },
          "old_value": { "text": "A" },
          "new_value": { "text": "C" }
        },
        {
          "field": { "name": "resolution_id" },
          "old_value": { "object": null },
          "new_value": { "object": 10 }
        },
        {
          "field": { "name": "resolution_summary" },
          "old_value": { "text": null },
          "new_value": { "text": "Reason for closure" }
        },
        {
          "field": { "name": "action" },
          "old_value": { "text": <OLD VALUE> },
          "new_value": { "text": "test" }
        }
    }

    The actual values for your custom field "action" depends on its type.

    One thing that can help is the fact that the SOAR UI uses the same REST API.  In particular, editing an incident field and clicking save will invoke this PATCH endpoint.  So all your need to do is to turn on the network tools in your brower, and observe what the request that the SOAR UI sends to SOAR.

    Hope that helps!



    ------------------------------
    Howard Lu
    ------------------------------