Wednesday, July 25, 2012

SCSM 2012: Notify "Assigned To" User When An End-User Comment Is Added To An Incident

Hello, I want to start off by letting you know that this is my first attempt at a blog, of any kind.  Knowing that along with the fact that my full-time job is managing a global service desk and not deploying or customizing SCSM for a living, try to bare with me as I get my feet wet.

A common question that I have seen in forums and other blogs is, "How do I actively notify the analyst responsible for an incident when a end-user adds a comment either via the SMPortal or email?".  

The answer is that there are a couple of ways to do this and several people have blogged about it but so far everything I have found refers to a solution for SCSM 2010 which required importing a custom workflow as described in
this blog by Marcel Zehner.

However, that workflow is no longer need in SCSM 2012 now that the "Trouble Ticket User Comments" and "Trouble Ticket Analyst Comments" classes have been made available to the Templates and Subscriptions wizards.  (I actually never used SCSM 2010 so I don't know if these classes were available in that release or not.)


The steps below show you how I answered this question and send email notifications to my analysts when an end-user comment is added to an incident.  The same general process can be followed to send notifications to the Assigned To user when an analyst adds a comment or it could be modified slightly to instead send the email to the Affected User.  The only difference would be to select the "Trouble Ticket Analyst Comments" class instead of "Trouble Ticket User Comments" when setting up the Template and Subscription as described below.



1)  Under Administration > Notifications > Templates select the task to Create E-mail Template. In the General section of the wizard enter the notification template name and optional description then select Trouble Ticket User Comments from the All basic classes list for your targeted Class.  Save this template to a custom management pack.



The General section should look something like this.


Now you can design your actual email template.

2)  In my notification email I wanted to include the text of the comment, who it was entered by, and when it was entered.  Since those are properties of the targeted class they are easily added to the email by clicking the Insert button and adding the Comment, Entered by, and Entered date properties under Work Item Comments Log.


Now you have the comment, who entered it and when in your email template but knowing those three things doesn't really help if you don't know what incident the comment was entered for.

3)  To help the analyst quickly identify what incident this comment was entered for I needed to add the incident ID and/or Title, I decided to add both.  To add the incident ID click the Insert button again and this time select Has User Comment in the Related classes section then enter "ID" in the Available properties search field to filter the list.  Several properties will be listed, scroll to the bottom of the list and add the ID property under Work Item.  To add the incident title to your email repeat this step but add the Title property under Work Item instead.


In my environment I chose to send my emails as HTML but that is not required for this template to work.  After all of your text and properties have been added your email template should look something like this.


4)  Now that your email template has been created it is time to create the subscription that will trigger the email.  Go to the Subscriptions view and click the Create Subscription task.  Enter the name and option description then select "When an object of the selected class is created" for the When to notify setting.  Just like the e-mail template, select the Trouble Ticket User Comments as the Targeted class and your custom management pack.


Don't select anything under the optional Additional Criteria, unless you want to.  In the Template section select the e-mail template you just created.

5)  In my environment I only wanted the recipient of this notification to be the Assigned To user of the incident so I left the Recipient section blank but added the Assigned To User property of the [Trouble Ticket] Has User Comment class to the Related Recipients section.



6) Save your subscription and that's it!  Any time a comment is entered either via the SMPortal or via the Exchange Connector the analyst assigned to the incident should be notified.

23 comments:

  1. Perfect! Thanks this could not have come at a better time for me.

    ReplyDelete
  2. Thanks a lot! I've checked in my environment - it works!

    ReplyDelete
  3. Question - All things work but when someone other then the affected user updates the ticket via e-mail it does not send a notification that it was updated. Just wondering if there is anything in the subscription I would need to change to allow this.

    Thanks

    ReplyDelete
    Replies
    1. Robfoxcaster,

      Are the other people who comment on the incident analysts or other end users? If they are other end users how are they commenting on the incident?

      Delete
    2. They are end users. The end user would repond to the e-mail with the IR in brackets which would update the call. It get's logged as an analyst comment instead of an end-user comment.

      I can send you a screenshot of the configuration if you'd like.

      Thanks

      Rob

      Delete
    3. Rob,

      I believe SCSM treats comments from anyone other than the "Affected User" on the incident as an Analyst Comment. You can setup a notification that gets triggered whenever an Analyst Comment is entered as well. Instead of using the class "Trouble Ticket User Comments" you would use the class "Trouble Ticket Analyst Comments". Keep in mind that this would send a notification every time an actual analyst makes a comment on an incident. You might be able to use the "Entered By" property to setup additional criteria in the subscription that would prevent it from sending a notification when an analyst makes a comment, I haven't tried that in my environment yet but I will when I have time.

      I'm curious, why or how are other end users other that are not the Affected User getting the email for an incident and why are they commenting on it? I haven't run into that scenario yet.

      Delete
    4. I've tried a few scenarios with the subscription using the same e-mail template and so far haven't figured out the right criteria yet. So far this is what i've tried:

      Trouble Ticket Analyst Comments
      Criteria - [Work item comments log] Entered by "Does not equal" affected user
      or [Work Item comments logs] Entered by "does not equal" assigned to user
      and [trouble ticket analyst comments] is private "equals" True

      I set the private to true since whenever I see the action log it has a box instead of a check in it. Not sure what that means but I assumed it sets it as private. Not sure why since all the updates from the affected user is not set to private.

      If an end user sends an incident via email they might copy someone else who might need to respond to update the ticket as well. Sometimes the affected user sends them the ticket info as well to update. It's great that it doesn't reject it but my analyst will never know that anyone other then the affect user has updated the ticket.

      Thanks

      Delete
    5. Rob,

      Try taking the private criteria out, by defualt any comment made is not private unless an analyst using the console checks that box to make it private.

      Delete
    6. Dustin - I tried that as well and if I send out a an e-mail to the affected user I get two e-mails. The analyst comment update subscription works but when the analyst sends an e-mail out to the affected user 2 e-mails are sent. One to the affected user which is fine but the analyst comment subscription sends one to the analyst of the question I sent to the affected user...if that makes sense.

      Delete
    7. Ok I tried it but no dice. I can receive the notification when a non-affected user respondsbut when I send out an e-mail as the assigned to user it sends to e-mails. One to the affected user and one to the assigned user. Not sure how to handle this properly.

      Delete
    8. Rob,

      That's a limitation of this, if you setup a notification to get sent when an analyst comment is made it's going to send an email any time that occurs unless you setup some criteria in the subscription to prevent it. You are allowing non-affected users to comment on tickets that aren't true analysts and it's not really designed for that consideration. I have never needed, or even wanted, someone other than the affected user to be able to comment on tickets so the end-user comment subscription is sufficient for me.

      You may need to look at creating a custom workflow for this so you can build some more logic into it than what the subscription wizard provides.

      Delete
    9. Is there a way to add all the comments for that incident to end user? so if the 3rd time the incident was updated with a comment then the email that went out would have 3 comments listed in it? EX:

      user comment #1
      i created your windows account:
      jowblow
      password

      user comment #2
      joe blow email has been created:
      jblow@blah.com

      user comment #3
      internal system account created:
      login jblow#2345
      pass: Password

      Delete
    10. This is working great for me for Incidents, but what about Service Requests. I've been looking for a solution to this and can't seem to find one at all.

      Delete
    11. I have this set up and it’s working well for Incidents in 2012, but I’m not getting any notifications for Service Requests when an End User updates the Action Log via the portal or Exchange Connector. Is there some additional configuration I need to apply, or a set up an additional subscription?

      Delete
  4. Everything great! But how to notify people that is in Related Items> Configuration Items?
    Previously they were in mail CC before Exchange Connector transformed e-mail to incident.

    ReplyDelete
  5. Hello!

    Very nice blog post. I used your instructions to create two different subscriptions:

    1) Send e-mails to users when the "Assigned to" analyst updates the ticket.
    2) Send e-mails do the "Assigned to" analyst when the user updates the ticket.

    However, in the template, I like to include the name of the user (for the 1st case) and the name of the analyst and the user (for the 2nd case).

    Do you think it is at all customizable?

    Thanks!

    ReplyDelete
  6. Dustin,

    Excellent blog post. Helped me a lot :) tnx

    ReplyDelete
  7. Dustin,

    Excellent. Helped me a lot :)

    ReplyDelete
  8. Hey, great blog post! Works great! Have you been able to get this to work for Service Request too? So far it only works for Incidents for me?

    ReplyDelete
  9. Nice post with great details. This is so helpful. Thanks for sharing.

    mass notifications

    ReplyDelete
  10. Thanks Dustin!

    One question. When the analyst gets the email with comment, it inculdes the entire body of the original email as well as the latest comment. Any way to just have the latest comment and not a copy of the original email body text?
    Example:
    Ticket ID#: IR851

    Ticket Title: Testing again..

    Comment Submitted By: Bill Tester

    Comment Submitted On: 5/3/2013 12:50:44 PM

    Comment: Printer jammed! From: Help Me Sent: Friday, May 03, 2013 12:49 PM To: Bill Tester Subject: Request For Information [IR851]: Testing again.. Hi Bill, What is the problem? Helpdesk ID: IR851 Status: Active Title: Testing again.. Description: Hi You can view request details by clicking here: All Requests Thanks

    ReplyDelete
  11. That's really good stuff. My buddies at work will definitely be awestruck ! Thanks for sharing.

    ReplyDelete