- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
10-22-2020 10:20 AM
Hi Team, I am using create_incident API to create incidents. Below is the sample code. I can create an incident when I use "messages" as String. Basically, this is custom_fields and its data vary from incident to incident. Some incidents may have 0 messages in the string array or some may have 10 messages.
-------------------------------------------------------------
api_instance = demisto_client.configure(base_url=base_url, api_key=api_key, debug=False, verify_ssl=False)
create_incident_request = demisto_client.demisto_api.CreateIncidentRequest()
create_incident_request.name = 'Sample1 Incident with custom fields'
create_incident_request.type = 'Access'
create_incident_request.owner = 'Admin'
create_incident_request.custom_fields= {'src': '1.1.1.1',
'dest': '192.168.1.1',
'malwarefamily': 'Trojan.Generic',
'filehash': '142b638c6a60b60c7f9928da4fb85a5a8e1422a9ffdc9ee49e17e56ccca9cf6e',
'vendorproduct': 'Secure Producnt',
'messages':"[{'messageid': 1, 'messagedetails':'First Message'}, {'messageid': 2, 'messagedetails':'Second Message'}]"
}
try:
api_response = api_instance.create_incident(create_incident_request=create_incident_request)
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->create_incident: %s\n" % e)
Is there any field type I can choose or Any way I can show these custom_fields messages in the form of a table on the incident screen?
Thanks in advance.
12-03-2020 01:10 PM
Hi JSannake,
It looks like you have a query for the XSOAR community. I would recommend posting this inquiry in their Live Community section.
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!