Incident Quick Templates
Published Feb 15 2019 08:06 AM 1,525 Views
First published on TECHNET on Sep 08, 2011

Below is a blog post from one of our Senior dev leads, Jakub Oleksy.  Thanks for creating this solution and writing it up Jakub!  I’ve wanted to do this for a long time but have just never gotten to it.

======================================================================================================================================

I had this idea after visiting one of our customers who was having a difficult time getting all incidents created since it took too long to create them while on a call with an end-user. This customer had many templates, so even going to the template picker and finding what you were looking for was burdensome. The idea here is to be able to quickly apply your most commonly used templates directly on a form, without using the template picker. This should help speed up creation for the most common scenarios that you can encode in templates. Note – The post is targeted at the Service Manager 2012 release, however, I have provided a version that works with Service Manager 2010 SP1; the only functional difference is that the console tasks cannot be grouped in SP1 and show up as individual tasks.

The way this ends up looking on a form is a console task group, with a fly-out of specific templates as seen below:

In SPI it looks like this:

The solution (you can download the files from the TechNet Gallery – see link below) is composed of two management packs. The first, Microsoft.ServiceManager.QuickTemplates.Library.mpb, is sealed and not something you will need to edit. It contains the actual console task assembly that implements this solution and needs to be imported into your system first. The second, Incident.QuickTemplates.xml, contains the usage of the first and actually drives the user experience seen in the images above. I’ve also included a key file for ease of deployment that I’ll describe the use of later.

For the rest of the post, I will describe the contents of Incident.QuickTemplates.xml and the process of deploying this solution into your environment.

When you open the MP, the first thing I’d like to discuss is the ConsoleTasks section. This is where we actually define our grouping and the individual templates we want to show up:

Incident.QuickTemplates.Group (Line 3) is the grouping mechanism that you see shown above as “Quick Templates”. You can create as many of these as you need, with different ID properties and you’d target all of them to System.WorkItem.Incident.

Next you see two sample console tasks representing the two sample templates, Incident.QuickTemplates.SampleTemplate1 (Line 22) and Incident.QuickTemplates.SampleTemplate2 (Line 20). You will want as many of these as you want templates shown on the form. You’ll notice the target is the group I just described (In SP1, these need to target Incident directly and the groups are removed from the management pack), but it could also be Incident directly if you don’t want the templates grouped. What you need to do is copy and paste these sample console tasks as many times as you need and change the third argument (Line 17 and 26) to be the Id of the template you want to map to; the rest of the XML should remain the same (aside from changing the ID). Note – This sample MP will not work in your environment since my template ids don’t exist there. The easiest way to get template ids is to search for them in the Service Manager Shell:

Here I searched for all templates with a display name that contains ‘Test’. You’ll want to search of the templates you want to use and copy their Id(s) to your own management pack.

Next, in order to control where the console tasks you defined show up, you need to add some categories to the management pack:

On Line 3, we define a category at the management pack level which is an indication to our UI to display console tasks found in this management pack. Since we also import legacy management packs from Operations Manager, this is required and indicates that the management pack contains console tasks that Service Manager supports. Notice on Line 6 I have included the public key token of this management pack. This is because I actually sealed this management pack prior to importing it, and that is the key for the sealed version. I did this because otherwise the user will get prompted before every execution of the task that the task may be unsafe. In order to seal the management pack, navigate in the Service Manager Shell to the directory where your unsealed management pack is and the key file included with this post is and run the following command (for SCSM 2012):

For SCSM 2010 you’ll need to seal the MP using fastseal.exe like this:

http://blogs.technet.com/servicemanager/archive/2009/12/25/sealing-management-packs.aspx

Next, you see three categories (Line 9, 12 and 15) that hide the console tasks from the views in the console, leaving them only to display in forms. You need to include these as this console task only works on forms.

I’ve also included mappings to the existing image for the “Apply Template” task so the UI looks a bit nicer for these:

Note: While the console tasks will show up in the UI without a restart, the images won’t appear until you close and reopen the console.

Finally, the display string section adds the display names for the management pack and all the console tasks:

Keep in mind that since these are just console tasks you can use user roles to scope the visibility of them so that users only see those quick template tasks which are relevant to their job role.

If this seems to be a pretty popular solution we might create a PowerShell cmdlet or something like that which makes generating this XML easier.

Let us know what you think!

You can get the solution files from the TechNet Gallery here:

http://gallery.technet.microsoft.com/Quick-Incident-Templates-dac8ca00

Version history
Last update:
‎Mar 11 2019 08:52 AM
Updated by: