Demisto : How to display List of Messages

Reply
Highlighted
L0 Member

Demisto : How to display List of Messages

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? 

 

Screenshot from 2020-10-22 22-29-37.png

Thanks in advance.

 

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 Live Community as a whole!

The Live Community thanks you for your participation!