Attach certain Knowledge Articles to work notes and others to Additional Comments

PabloJL18
Tera Contributor

Hello Community,

I need help on how to restrict knowledge articles attachment on incident records based on Knowledge base. For example:

  1. Knowledge articles from End User knowledge base (visible to all) are attached to additional comments.
  2. Knowledge articles from other knowledge bases are attached to Tasks' work notes

I've checked the knowledge articles properties and Search Action Configuration (Attach) under Table Configuration (Incident) for the setup but those only can achieve the post on any one of the journal field irrespective of the KB Base. 

I'll appreciate the help

 

5 REPLIES 5

Riya Verma
Kilo Sage
Kilo Sage

Hi @PabloJL18 ,

Hope you are doing great.

  1. Identify Knowledge Bases:

    • Determine the specific knowledge bases that should allow attachments on additional comments for incidents and those that should allow attachments on tasks' work notes.
    • Note down the unique identifiers (sys_ids) of the knowledge bases involved in the process.
  2. Customize Attachment Behavior:

    • Navigate to "Table Configuration" in the ServiceNow platform and locate the "Incident" table.
    • Open the "Search Action Configuration" related list and find the "Attach" action.
    • Edit the "Attach" action and add a new condition to check the knowledge base associated with the knowledge article being attached.

 

// Get the knowledge base sys_id of the attached knowledge article
var kbSysId = current.kb_knowledge.kb_knowledge_base;

// Check the knowledge base and set the appropriate attachment field
if (kbSysId === 'END_USER_KB_SYS_ID') {
    action.setRedirectURL('incident.do?sys_id=' + current.sys_id + '&sysparm_query=' + gs.urlEncode('active=true^additional_commentsISEMPTY'));
} else if (kbSysId === 'OTHER_KB_SYS_ID') {
    action.setRedirectURL('task.do?sys_id=' + current.sys_id + '&sysparm_query=' + gs.urlEncode('active=true^work_notesISEMPTY'));
}

 

 

  1. Customize the Redirect URL:

    • Update the code snippet above by replacing 'END_USER_KB_SYS_ID' and 'OTHER_KB_SYS_ID' with the actual sys_ids of the respective knowledge bases.
    • Modify the redirect URL to include the appropriate field based on your instance's field names for additional comments and work notes.

 

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma

Hi @Riya Verma 

Thank you for your answer, I just want to be sure in this step

  • Edit the "Attach" action and add a new condition to check the knowledge base associated with the knowledge article being attached.

Where do I add the condition? I'm not able to find a field to add the condition in the Attach form. Is it in the dictionary entry of the attach note field using calculated value? 

Community Alums
Not applicable

I'd also like to know this- there is no condition field on the Search action record form/table

bsbjb
Giga Contributor

Hi Riya,

 

I'm not able to find a field to add the condition in the Attach form.Can you please tell us where we can find this.