locked
SCSM 2012 Email Notification RRS feed

  • Question

  • I'm trying to setup a notification subscription to email the Assigned User's manager when an incident's SLO has breached. Is this possible?

    I've set up the subscription using the Service Level Instance Time Information Class and triggered the notification "When an object of the selected class is updated" and the Service level Instance Time Information class. Criteria - Status does not equal breached ... changes to breached. Using this class, I am able to notify the affected user, but do not see a "Managed by" or anything to accomplish notifying that person's manager.

    Any advice is appreciated. 

    Thanks.

    Thursday, May 31, 2012 2:39 PM

Answers

  • Probably you would need a custom workflow assembly which requires dev work. Manager is transferred by default by the AD Connector but it is not a relationship that you can send to. However, in a custom workflow activity assembly it would be very easy to pass the template id for the notification template and instance id for the incident. Then you would just need to get Manager for the user and translate this into an EnterpriseManagementObject to get the Manager Id.

    To send a notification:

    //Sends a notification email
    public partial class NotificationsClass : SendNotificationsActivity
    {
        public EnterpriseManagementException SentNotification(
            string sId,
            Guid gTemplateId,
            string sUserId,
            ActivityExecutionContext executionContext
            )
        {
            try
            {
                NotificationsClass nc = new NotificationsClass();
                nc.InstanceId = sId;
                nc.TemplateIds = new string[] { gTemplateId.ToString() };
                nc.PrimaryUserList = new string[] { sUserId };
                nc.Execute(executionContext);
                return null;
            }
            catch (EnterpriseManagementException eme)
            {
                return eme;
            }
            catch (System.Exception e)
            {
                return null;
            }
        }
    }


    Rob Ford scsmnz.net

    • Marked as answer by SirKoon Thursday, June 14, 2012 3:14 PM
    Monday, June 11, 2012 7:27 PM
  • Thanks Rob, that makes sense. However, after some thought, I found a more simplistic solution to accomplish my goal. I went ahead and just created unique subscriptions for each of our managers based upon the incident's support group. (i.e. if SLO= Breach and Support Group = X, Y, or Z,  notify manager A) 
    • Marked as answer by SirKoon Thursday, June 14, 2012 3:14 PM
    Thursday, June 14, 2012 3:03 PM

All replies

  • Probably you would need a custom workflow assembly which requires dev work. Manager is transferred by default by the AD Connector but it is not a relationship that you can send to. However, in a custom workflow activity assembly it would be very easy to pass the template id for the notification template and instance id for the incident. Then you would just need to get Manager for the user and translate this into an EnterpriseManagementObject to get the Manager Id.

    To send a notification:

    //Sends a notification email
    public partial class NotificationsClass : SendNotificationsActivity
    {
        public EnterpriseManagementException SentNotification(
            string sId,
            Guid gTemplateId,
            string sUserId,
            ActivityExecutionContext executionContext
            )
        {
            try
            {
                NotificationsClass nc = new NotificationsClass();
                nc.InstanceId = sId;
                nc.TemplateIds = new string[] { gTemplateId.ToString() };
                nc.PrimaryUserList = new string[] { sUserId };
                nc.Execute(executionContext);
                return null;
            }
            catch (EnterpriseManagementException eme)
            {
                return eme;
            }
            catch (System.Exception e)
            {
                return null;
            }
        }
    }


    Rob Ford scsmnz.net

    • Marked as answer by SirKoon Thursday, June 14, 2012 3:14 PM
    Monday, June 11, 2012 7:27 PM
  • I was trying to do the same and found that u can drill down in the related recipients:

    Work Item has Service Level Instance information[Work Item] ->About Configuration Item[User] ->Assigned to User[Work Item] ->About configuration Item[User] ->Manages User[User]

    but nothing is received can someone help on this, I think it can be done but what exactly to select? without writing a custom workflow...

    Tuesday, June 12, 2012 10:05 AM
  • Thanks Rob, that makes sense. However, after some thought, I found a more simplistic solution to accomplish my goal. I went ahead and just created unique subscriptions for each of our managers based upon the incident's support group. (i.e. if SLO= Breach and Support Group = X, Y, or Z,  notify manager A) 
    • Marked as answer by SirKoon Thursday, June 14, 2012 3:14 PM
    Thursday, June 14, 2012 3:03 PM
  • I did the same, but I am worried about the impact of having more and more notifications like this, and the performance impact it "can?" have.
    Also a very cumbersome workaround as its slow to create the multitude of notifications, instead of using an available property.

    Would prefer to use the :

    Work Item has Service Level Instance information[Work Item] ->About Configuration Item[User] ->Assigned to User[Work Item] ->About configuration Item[User] ->Manages User[User]

    Has anyone succeded in this yet?

    Monday, July 8, 2013 1:36 AM