IBM QRadar SOAR

IBM QRadar

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
Expand all | Collapse all

How to get the current incident details while adding a new artifact

  • 1.  How to get the current incident details while adding a new artifact

    Posted Wed April 17, 2019 07:14 AM

    Hi,

     

    I am adding new artifact using 'Add Artifact' option and I need the details of the current incident which the artifact is being added using python code. Basically I need few property values (custom fields) from the current incident to invoke the client API while adding the artifact to get do the threat lookup service.

     

     

    Thanks & Regards,

    Jojo Augustine



  • 2.  RE: How to get the current incident details while adding a new artifact

    Posted Tue April 23, 2019 10:28 AM
    Edited by CRAIG R Tue April 23, 2019 10:29 AM
    The preferred way is to just pass them down as function inputs. i.e. if you have "My Custom Field" in the UI its API name would usually be my_custom_field

    On your function defined some additional inputs to "carry" your properties like my_function_custom_field_1 then in your preprocessing script for the function just call the property into the input. 

    inputs.my_function_custom_field_1 = incident.properties.my_custom_field 

    The alternate is to send down the incident ID as a function input (inputs.my_function_incident_id = incident.id ) then in your function 

    resilient_client = self.rest_client()
    incident = resilient_client.get("/incidents/{}".format(my_function_incident_id) )
    my_custom_field = incident['properties']['my_custom_field']


    I would strongly recommend against this as functions should be designed without assuming fields or other fixed content in Resilient - this allows consumers of your app to choose what field they want to map to your input. I am just including it as it might be useful for some other cases. 

    I hope that helps and answers your question,

    ------------------------------
    CRAIG R
    ------------------------------