User Tools

Site Tools


common_knowledge_format

Common Knowledge Format

Version Author
Bismuth rpage

The following is the default implementation of the common knowledge format. The common knowledge format mirrors what one would see in a Knowledge Article form in ServiceNow with related lists expressed in embedded XML form. The Common Knowledge 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 Knowledge Article and its related records.

Implementation

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.

Dynamic Shares

To support creating new Affected Product records, please set up a dynamic share on the cmdb_ci table with insert and/or update triggers enabled based on your use case. If this share is not configured, you may utilize existing Affected Products only.

Outbound Table Maps

The following table maps construct the outbound messages to be queued. Specify the main Change to Common Knowledge Table Map in your Dynamic Share as the root map.

Name Type Source table Description
Knowledge to Common Knowledge common_knowledge Knowledge [knowledge] Main body of the common_knowledge format
Affected Products embedded_affected_product Knowledge Related To Products [m2m_kb_ci] Map for building embedded affected products in common_knowledge
Approvers embedded_approver Approval [sysapproval_approver] Map for building embedded approvers in common_knowledge
Knowledge Feedback embedded_knowledge_feedback Knowledge Feedback [kb_feedback] Map for building knowledge feedback in common_knowledge

Inbound table Map

In order to process messages of topic: siam and type: common_knowledge, 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)

Import Set

The import set table is called u_psp_common_knowledge and has a transform map called PSP Common Knowledge to Knowledge. This transform map has transform scripts that are responsible for parsing the embedded sections of common_knowledge:

  • affected_products
  • approvers
  • knowledge_feedbacks

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

  • PerspectiumAffectedProduct
  • PerspectiumApprover
  • PerspectiumKnowledgeFeedback

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

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 knowledge article, 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:

  1. Create a tag in the “label” table (type “label.list” in the Filter Navigator box to quickly go to the label table):

  1. Use a unique name such as “msp_client_sent” or “msp_client_knowledge_sent” to ensure this tag is not used by other MSP or SIAM integrations. If you create the tag as “msp_client_knowledge_sent”, you can skip the next step and are done setting up a tag.
  2. Go to the Perspectium > Control and Configuration > Table Maps and open the “Knowledge to Common Knowledge” outbound table map
  3. Open the field map that begins with “${TM:psp_attachment”:
  4. In this field map, replace “msp_client_knowledge_sent” with the name of the tag you created in step one:
  5. Go to the Import Set table (type in “u_psp_common_knowledge.list” in the Filter Navigator box) and click on the “Transform maps” UI action
  6. Open the “PSP Common Knowledge to Knowledge” table transform map and then go to the “Transform Scripts” section
  7. Open up the attachment transform script and change “msp_client_knowledge_sent” to the tag created in step one. Note, keep the “” around the tag when you replace it here. For example, if your tag is named mycompany_sent, change “msp_client_knowledge_sent” to “mycompanysent”:

Sample Output

<?xml version="1.0" encoding="UTF-8"?>
<common_knowledge>
    <active>1</active>
    <affected_products>
        <affected_product>
            <kb_name>KB0000033</kb_name>
            <ci_name>*DAVID-IBM</ci_name>
        </affected_product>
    </affected_products>
    <approvers>
        <approver>
            <created>2018-01-23 18:18:15</created>
            <approver_name/>
            <assignment_group_name/>
            <approver/>
            <state>approved</state>
            <comments/>
            <approver_email/>
            <assignment_group/>
        </approver>
    </approvers>
    <article_type>text</article_type>
    <author>6816f79cc0a8016401c5a33be04be441</author>
    <cannot_read_user_criteria/>
    <can_read_user_criteria/>
    <category/>
    <cmdb_ci/>
    <description/>
    <direct>0</direct>
    <disable_commenting>0</disable_commenting>
    <disable_suggesting>0</disable_suggesting>
    <display_attachments>0</display_attachments>
    <flagged>0</flagged>
    <image/>
    <kb_category>c78a2d2047b002007f47563dbb9a71bf</kb_category>
    <kb_knowledge_base>a7e8a78bff0221009b20ffffffffff17</kb_knowledge_base>
    <knowledge_feedbacks>
        <knowledge_feedback>
            <sys_created_on>2017-05-19 19:37:36</sys_created_on>
            <user>6816f79cc0a8016401c5a33be04be441</user>
            <sys_tags/>
            <comments/>
            <live_message/>
            <flagged>0</flagged>
            <work_notes/>
            <sys_domain_path>/</sys_domain_path>
            <resolved>0</resolved>
            <parent_feedback/>
            <sys_created_by>admin</sys_created_by>
            <sys_updated_by>admin</sys_updated_by>
            <root_feedback/>
            <view_id/>
            <session_id/>
            <search_id/>
            <sys_domain>global</sys_domain>
            <sys_updated_on>2018-01-25 19:08:04</sys_updated_on>
            <rating/>
            <useful>yes</useful>
            <article>e97ee81eff6002009b20ffffffffffe0</article>
            <query/>
            <sys_mod_count>4</sys_mod_count>
        </knowledge_feedback>
        <knowledge_feedback>
            <sys_created_on>2017-05-19 19:37:36</sys_created_on>
            <user>6816f79cc0a8016401c5a33be04be441</user>
            <sys_tags/>
            <comments>No info about topic</comments>
            <live_message/>
            <flagged>1</flagged>
            <work_notes/>
            <sys_domain_path>/</sys_domain_path>
            <resolved>0</resolved>
            <parent_feedback/>
            <sys_created_by>admin</sys_created_by>
            <sys_updated_by>admin</sys_updated_by>
            <root_feedback/>
            <view_id>169ba860d731310013ab49547e610362</view_id>
            <session_id/>
            <search_id/>
            <sys_domain>global</sys_domain>
            <sys_updated_on>2018-01-25 19:08:04</sys_updated_on>
            <rating/>
            <useful>yes</useful>
            <article>e97ee81eff6002009b20ffffffffffe0</article>
            <query/>
            <sys_mod_count>2</sys_mod_count>
        </psp_knowledge_feedback>
    </knowledge_feedbacks>
    <meta/>
    <number>KB0000033</number>
    <published>2015-06-11</published>
    <rating/>
    <retired/>
    <roles/>
    <short_description>Eclipse configuration for Android development.</short_description>
    <source/>
    <sys_class_name>kb_knowledge</sys_class_name>
    <sys_created_by>admin</sys_created_by>
    <sys_created_on>2015-06-11 17:10:27</sys_created_on>
    <sys_domain>global</sys_domain>
    <sys_domain_path>/</sys_domain_path>
    <sys_mod_count>41</sys_mod_count>
    <sys_tags/>
    <sys_updated_by>admin</sys_updated_by>
    <sys_updated_on>2018-01-25 19:08:11</sys_updated_on>
    <sys_view_count>0</sys_view_count>
    <text><h2> </h2></text>
    <topic>General</topic>
    <use_count>0</use_count>
    <valid_to>2020-01-01</valid_to>
    <wiki/>
    <workflow_state>published</workflow_state>
</common_knowledge>

The following Perspectium Inbound/Outbound Message unloads can be un-gzipped and uploaded into your instance of ServiceNow to view and used for testing.

Common Knowledge Sample - Inbound.xml.zip

Common Knowledge Sample - Outbound.xml.zip

common_knowledge_format.txt · Last modified: 2018/01/28 12:29 by ryan.page