Version | Author |
---|---|
Argon | pnguyen |
The following is the default implementation of the common problem format. The common problem format mirrors what one would see in an ITIL view of the Problem form in ServiceNow with related lists expressed in embedded XML form. The Common Problem 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 a Problem 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 Problem Table Map in your Dynamic Share as the root map.
Name | Type | Source table | Description |
---|---|---|---|
Problem to Common Problem | common_problem | Problem [problem] | Main body of the common_problem format |
psp_attachment | embedded_attachment | sys_attachment | Map for building embedded attachments field |
psp_incident | embedded_incident | Incident [incident] | Map for building embedded incidents |
psp_problem_task | embedded_problem_task | Problem Task [problem_task] | Map for building embedded problem tasks |
In order to process messages of topic: siam and type: common_problem, 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_problem and has a transform map called PSP Common Problem to Problem. This transform map has transform scripts that are responsible for parsing the embedded sections of common_problem:
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_problem> <active>1</active> <activity_due/> <additional_assignee_list/> <approval>not requested</approval> <approval_history/> <approval_set/> <assigned_to/> <assignment_group/> <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+YAbsIA1L9pKQVcatUPHkqQt8sGhg0O7Qrl5nXItUtk2aokVqi12EqME281J1mfsN8qr9mY9itnDIe/tbPYGOOoWoRkhlabNKbGlBs7Nezod8tZfLKtZDxOA8k5/VaxHiOgzxmsIbGBZEOb1Ubx96h4zqxatuaZuKGIOe7LYFvvDTz/mkBcS03qk8cSU9wkXgoUa8t6GnNaS/j3KMfG9BDnMKF0TA375NnWDy74MdT0R+4PkOhcvbsDvPq9EvGgLPHMSX1VXe7hAuY/kPY0+5kVz+P47zPIhsHqEX20iZTHfzt+VsEocmw/FYvEi2uzOTTGRQEtWW2DmyB5Hlze1nLxNymux+L7T/fYGFZnMEkrBouE/cr+NqtXqyGRGe1hNNIaSK05gQXUwrlZr5OawDNawnZN3m+INpT9EJ1yhMoeyrC3y17PTKTevdhcwPtwE3ItZ+oA7VXzHXo2GeTToDr8aX9X3wZLWAV2Jt/TQm2LlKN58+XtTatHcFRz3y/k7tVCwEWh9ALIXGvPHHdwfzweoD9Kc1QdLwVfAsySMaPVKrooxLussT1V/B544COtu9+j6q25Z/bUKigUXGlYUWnmFR5bL0FzSvu1k59tEhLONnHHGxx+Tcb7pi/h8UyxaETDCW/iUNYsuutro+pL2bWfOh37L/Yy3vrLCvF0GUf+AacEl4AjTBuiXhWnL/v4qaBpt1L7Xn9Xi/swxaG9GMsWN1kPWuJ7daX3CS/qzBu3PZnv9mbTF4bm3bPRAjeBZ85/ebrU7/M3+t5j0vxPa+5KnjchDkrvvGYbhtT7mjfrfTbDX/25WCn5MvdjTX57127V2pz38kTd7vijJ8Xxhu3S2IAW5H68n05HtOa4hH/Km5gsYJ3bnC/Kzh7uNSV2QNuL+QcqRD1nzm0yJ2HXHBboOZKydzG/9jtFvecYhbzK/zWHbp+Y3nzrQU7SgXtf9+8q9JqmbHPstMx8uzNR8TArYRLgWd/NB7HpEh/mbno+p92A+RokDPAgjVMlRz7LeP5Tbbvz+waxBEB3IVNc0U+8fuh3jg/rw5/cPSlrM/rnz7evivJyX83Le3LwHg8HJeM/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/> <calendar_duration/> <closed_at/> <closed_by/> <close_notes/> <cmdb_ci/> <comments/> <comments_and_work_notes/> <company/> <contact_type/> <correlation_display/> <correlation_id/> <delivery_plan/> <delivery_task/> <description>Memory problem I'm having with my computer</description> <due_date/> <escalation>0</escalation> <expected_start/> <follow_up/> <group_list/> <impact>3</impact> <incidents> <incident> <number>INC0000001</number> <opened_at>2017-02-28 23:09:51</opened_at> <category>network</category> <caller_id_name>Fred Luddy</caller_id_name> <assigned_to_name>Charlie Whitherspoon</assigned_to_name> <short_description>Can't read email</short_description> <priority>1</priority> <id>9c573169c611228700193229fff72400</id> <state>7</state> <assignment_group_name>Service Desk</assignment_group_name> </incident> </incidents> <knowledge>0</knowledge> <known_error>0</known_error> <location/> <made_sla>1</made_sla> <number>PRB0040001</number> <opened_at>2017-09-29 05:07:01</opened_at> <opened_by>6816f79cc0a8016401c5a33be04be441</opened_by> <order/> <parent/> <priority>5</priority> <problem_state>1</problem_state> <problem_tasks> <problem_task> <cmdb_ci/> <assigned_to/> <state>1</state> <short_description>Related problem task</short_description> <assignment_group/> <number>PTASK0010001</number> <priority>4</priority> </problem_task> </problem_tasks> <provider>servicenow</provider> <reassignment_count>0</reassignment_count> <rejection_goto/> <related_incidents>1</related_incidents> <rfc/> <short_description>Memory problem</short_description> <sla_due/> <state>1</state> <sys_class_name>problem</sys_class_name> <sys_created_by>admin</sys_created_by> <sys_created_on>2017-09-29 05:07:47</sys_created_on> <sys_domain>global</sys_domain> <sys_domain_path>/</sys_domain_path> <sys_mod_count>3</sys_mod_count> <sys_tags/> <sys_updated_by>admin</sys_updated_by> <sys_updated_on>2017-09-29 05:14:19</sys_updated_on> <time_worked/> <upon_approval>proceed</upon_approval> <upon_reject>cancel</upon_reject> <urgency>3</urgency> <user_input/> <variables/> <watch_list/> <wf_activity/> <work_around/> <work_end/> <work_notes/> <work_notes_list/> <work_start/> </common_problem>
The following Perspectium Inbound/Outbound Message unloads can be un-gzipped and uploaded into your instance of ServiceNow to view and used for testing.