How to create a link to a Knowledge Article in an email template

What if I told you.. you could make a direct link to a knowledge article that is attached to an Incident (or other workitems) and present it in an email template to a user.

Scenario:

 

1) The supporter gets a new Incident from an end-user:

IncidentForm

2) Instead of writing the same message over and over, he or she decides to attach a knowledge article related to the issue and send a little message along to the end-user:

IR-formWithKA

newmessage

3) The end-user then receives a new email triggered from the SendEmail worklfow

email

4) He can then click on the link and receive the knowledge article:

link

word

 

Requirements and limitations:

  • Service Manager Portal in use and reachable from the client computer
  • You can only attach 1 knowledge article for the link to work.
  • Knowledge articles you attach needs to be in published status

How to:

Basically all you need to know is how to make the URL to the knowledge article. You can then use that in any email template you like and in any kind of workflow.

The URL consists of a SMPortal URL and a GUID to the knowledge article

Find the URL to the portal:

Every knowledge article you publish can be found on the SMPortal. And the URL looks like this:

Example:

I have retrieved the url via a firefox extension called firebug. But alot of tools out there can probably do the same. This was needed as I couldn’t see urls via silverlight pages.

Find the GUID:

Now we just need to insert the GUID after the =.

The property is not available in the property selector, even though there are many candidates (About Config Item or Relates to Config Item etc.) But after some powershell digging via the get-scsmrelationshipclass cmdlet. I found the following relation:System.EntityLinksToKnowledgeDocument that is found in the System Knowledge Library management pack.

Entity is parent to the workitem class that is a parent to a troubleticket and parent to an incident. So you should be able to use the relation with all workitems and configitems.

The property then looks like this:

$Context/Path[Relationship=’CustomSystem_Knowledge_Library!System.EntityLinksToKnowledgeDocument’ TypeConstraint=’CustomSystem_Knowledge_Library!System.Knowledge.Article’]$?$Id$?

Where CustomSystem_Knowledge_Library refers to:

This reference is needed. When you make the email template, you can select the following property from the property selector and then hit OK. This wil create the reference. You can then delete that property again and the reference still stays.

property

Source: Incident class

So here is the complete URL you need:

http://<yourservicemanagerportal>:<port>/ContentHost/ClientBin/KnowledgeArticleViewer.aspx?ArticleId=$Context/Path[Relationship=’CustomSystem_Knowledge_Library!System.EntityLinksToKnowledgeDocument’ TypeConstraint=’CustomSystem_Knowledge_Library!System.Knowledge.Article’]$?$Id$?

Example URL with Knowledge Article Title:

<a href="http://servicemanager:8080/ContentHost/ClientBin/KnowledgeArticleViewer.aspx?ArticleId=$Context/Path[Relationship=’CustomSystem_Knowledge_Library!System.EntityLinksToKnowledgeDocument’ TypeConstraint=’CustomSystem_Knowledge_Library!System.Knowledge.Article’]$?$Id$?">$Context/Path[Relationship=’CustomSystem_Knowledge_Library!System.EntityLinksToKnowledgeDocument’ TypeConstraint=’CustomSystem_Knowledge_Library!System.Knowledge.Article’]/Property[Type=’CustomSystem_Knowledge_Library!System.Knowledge.Article’]/Title$</a>

 

And that’s it. Please leave a comment or write me an email if you have any questions or issues regarding this.

By | 2013-08-01T21:29:56+00:00 August 1st, 2013|Service Manager (SCSM)|1 Comment

About the Author:

Morten Meisler

Consultant / Developer / Trainer

Key areas / products:

  • System Center Service Manager
  • System Center Operations Manager
  • Automation (System Center Orchestrator / Service Management Automation (SMA))
  • Development: C#.Net, Powershell, SQL, Web development / HTML5 (Javascript,jQuery,CSS,HTML, Wordpress etc.)

One Comment

  1. Jus March 10, 2015 at 14:07 - Reply

    Many thanks – although not exactly what I required (we needed the Parent Service Request Work Item GUID (not just the ID) in a notification email), this article pointed me in the right direction for where to look. No other webpage came even close to giving me the right suggestions! Many thanks again!

Leave A Comment