Version | Author |
---|---|
Argon | pnguyen |
The following is the default implementation of the common incident format. The common incident format mirrors what one would see in an ITIL view of the Incident form in ServiceNow with related lists expressed in embedded XML form. The Common Incident update set will include a Table Map that generates the below XML payload when specified in a Dynamic Share, it also includes the default Import Set Table and Transform Maps to ingest this format and produce all the artifacts that comprises of an Incident and its related records.
The implementation of any common document format is symmetrical which means that the output, when consumed, should produce the same or similar records at the target. The implementation should also exhibit idempotent behavior which means that when the same document is consumed and processed repeatedly, the same result appears or is ignored because the results already exists.
For the correct outputs to be produced, you must create 2 Dynamic Shares - one to capture the comments and work_notes field values in a before context, and the other as async mode to capture the related records in a delayed step.
In the before Dynamic Share, use the following code snippet to prevent unwanted outbound messages to be queued when comments or work_notes are not updated.
if (current.comments.nil() && current.work_notes.nil()) { ignore = true; }
The following table maps construct the outbound messages to be queued. Specify the main Change to Common Incident Table Map in your Dynamic Share as the root map.
Name | Type | Source table | Description |
---|---|---|---|
Incident to Common Incident | common_incident | Incident [incident] | Main body of the common_incident format |
psp_attachment | embedded_attachment | sys_attachment | Map for building embedded attachments field |
psp_affected_ci | embedded_affected_ci | CIs Affected [task_ci] | Map for building embedded affected CIs |
In order to process messages of topic: siam and type: common_incident, you must create an inbound table map to target the import set table as follows. (This map should have been included in the provided update set already)
The import set table is called u_psp_common_incident and has a transform map called PSP Common Incident to Incident. This transform map has transform scripts that are responsible for parsing the embedded sections of common_incident:
Select to deactivate each of these transform scripts if you choose not to parse these embedded objects into records. If you need to extend or add additional capabilities, instead of modifying the existing scripts, add new ones so that upgrades are possible.
These transform scripts use specific script includes to assist in parsing and ingesting the embedded objects into the correct artifacts. The script includes are
These script includes are included as part of the Common Endpoint update set that should be installed prior to installing the common object format update sets.
Attachments are automatically embedded inside the Common Document Format record that is shared and subscribed to by MSPs and Customer Endpoints. This is done using embedded table maps that are included with the Common Endpoint update set. Attachments are limited to 7MB in size per outgoing Common Document Format record.
To ensure that duplicate attachments are not sent out in an incident, a “tag” should be created so as to tag attachments. This way, when a record is updated and attachments are queried for that record to embed, it will ignore attachments that have been sent and are “tagged”.
To setup a tag:
<?xml version="1.0" encoding="UTF-8"?> <common_incident> <action>Insert</action> <active /> <activity_due /> <additional_assignee_list /> <affected_cis> <affected_ci> <ci_name>789188b1db1272005507f3561d9619b3</ci_name> <ci_id>72e91bb84f110300d8f453418110c785</ci_id> </affected_ci> <affected_ci> <ci_name>usgson364</ci_name> <ci_id>661c5ff84f110300d8f453418110c719</ci_id> </affected_ci> </affected_cis> <approval /> <approval_history /> <approval_set /> <assigned_to_name /> <assigned_to_email /> <assignment_group_name /> <attachments> <attachment> <data>iVBORw0KGgoAAAANSUhEUgAAAK8AAABBCAMAAACQAgS1AAAA1VBMVEX///8AAAAAmTP3+/gAlSP39/f4+fsmRGFSUlJISEiMjIwAiwAAlCvV1dWCgoLo8+vXzdSurq7V7N3N49EAigp3u4Q9nUzc7N8xMTGOjo4AhAAwm0NNTU2np6cqKipoaGh5eXlBQUEgICB/vosODg7v7++fn58ZGRnMzMzY2Ng7OzvAwMAAeQBdXV2GwJNsr3St1bdgsG9UpmAvnkYAkwo7nEm+3cVqt3uq0bEhlzecy6aJvJGyzrULjSKQy6Bar2czjzbG28tKolcAHEWSnamXxJwhmzvL0grXAAAEZUlEQVRoge2Za3+qOBCHQWJXFGUrUS6lipeK4lFbu1K10otn2+//kTYTwkVtOdjqr/si/1fMEPTpOJnMUEHg4uLi4uLi+p/p4kwSBOkk2uf996+z6PdIwhh9X/+oe7xl8Tz6W6oohe8LcV7Oy3k579d4HbPMZJoloxZb4Gi3yAK5bLLbNn2gFa8xJ1m8SqR9W9lbcxzvTerOoL239LIriuXYGod/YOp2Bi+qRMKIouHEwZYhnLqfl7cjJ2q5aUuW7Q5Z0I1Njz6Q2LLxOS9+UOuhNrNKQHDvfT20tddZSIjwzK/rdb9XwUfwyqVERtcu7Wpii63EItEW+53E9jJ4e8kX6k1cQAs9cfgrAoxWWnwf5efNzAdBGIm13Sfl1AMZ+YAbsIA1L9pKQV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/z/7fimXSu/29ycXFxcXFx/YD+A/kcro9vgcpQAAAAAElFTkSuQmCC</data> <size_bytes>1407</size_bytes> <file_name>db2.png</file_name> <sys_id>3775ab304f510300d8f453418110c761</sys_id> <content_type>image/png</content_type> </attachment> </attachments> <business_duration /> <business_service_name /> <business_stc /> <calendar_duration /> <calendar_stc /> <caller_id /> <caller_full_name /> <caller_first_name /> <caller_last_name /> <caller_email /> <category /> <caused_by /> <child_incidents /> <close_code /> <close_notes /> <closed_at /> <closed_by_id /> <closed_by_full_name /> <cmdb_ci_id /> <cmdb_ci_name /> <comments>Not sure why but I can't access my email</comments> <comments_and_work_notes /> <company_id /> <company_name /> <contact_type /> <correlation_display>XF99136354</correlation_display> <correlation_id>XF99136354</correlation_id> <delivery_plan_display /> <delivery_task_display /> <description /> <due_date /> <escalation /> <expected_start /> <follow_up /> <group_list /> <impact /> <incident_state /> <knowledge /> <location_id /> <location_name /> <made_sla /> <notify /> <number>INC2028206</number> <opened_at /> <opened_by_id /> <opened_by_full_name /> <opened_by_email /> <order /> <parent_id /> <parent_incident_number /> <priority /> <problem_id /> <problem_number /> <provider>servicenow</provider> <reassignment_count /> <reopen_count /> <resolved_at /> <resolved_by_id /> <resolved_by_full_name /> <resolved_by_email /> <rfc_id /> <rfc_display /> <severity /> <short_description>Email issue</short_description> <sla_due /> <state /> <subcategory /> <time_worked /> <urgency /> <variables /> <watch_list /> <work_end /> <work_notes /> <work_start /> </common_incident>
The following Perspectium Inbound/Outbound Message unloads can be un-zipped and uploaded into your instance of ServiceNow to be viewed and/or used for testing.