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:
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:
Wouldn't it be possible to group tasks in SCSM2010 aswell? The reports underneath the Reports task is grouped?
No unfortunately, not in this case. The difference is console tasks that are targeted at a class (i.e. relative to the selected object) vs. tasks which are targeted at a view.
Those which are targeted at a view (e.g. reports or the create connector tasks) can have flyout menus. The console tasks that are targeted at a class cannot until 2012.
Great! Several days ago a try do to what but attribute IsGroupTask was unknow for me))
About task target at view - I don't how it's work in SCSM2012, but in current release you can target task to another task to create grouped task.
That is correct but you can only group tasks if the base task is targeted at a view and not a class.
Thanks for the post
I have a similar request from a customer to build a task in the incident screen that will open the create user interface. Is it a similiar approach?
Thanks in advance
Thanks! This is an extremely helpful addition.
This looks like a great solution however this seems to imply that the templates have to be predefined before you implement this. Is this the case or am I reading it wrong. Can new templates be dynamically added later?
You can add/remove templates later by editing the XML to add/remove them. then re-import the MP and restart the console to pick up the changes.
Do you have something like this but to quickly create an incident based on a template?
We're using SCSM to support multiple customers and we have a custom incident property to identify them. We need to apply different SLAs based on the customer. The problem is that if they use the "Create incident" task it's going to use the internal default template, and I'm trying to provide a quick way for them to create an incident through the console.
Nevermind, I just found Patrik's solution for it: