Attach certain Knowledge Articles to work notes and others to Additional Comments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 08:39 AM
Hello Community,
I need help on how to restrict knowledge articles attachment on incident records based on Knowledge base. For example:
- Knowledge articles from End User knowledge base (visible to all) are attached to additional comments.
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 12:50 PM
Hi @PabloJL18 ,
Hope you are doing great.
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.
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'));
}
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.
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2023 02:52 PM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2023 07:21 PM
I'd also like to know this- there is no condition field on the Search action record form/table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 06:55 AM
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.