jason_petty
Tera Expert

I had a customer want to set up a notification that users could subscribe to. They wanted the notifications to be email and SMS. I could not find any real good step by step explanation on how to do this. That is why I am posting this blog.

In this example we will set up a notification that sends email or SMS to users when the Impact of an incident is set to 1. There are two ways to trigger notifications. First, you can trigger it from an insert or update of a record in a table. Second, you can trigger it from an event with a business rule. Below are examples of each way:

  1. Create Notification to be triggered from an insert or update of a record in a table

    1. Make sure outbound email is set up and working. See WIKI http://wiki.servicenow.com/index.php?title=Configuring_Email for this.
    2. Create New Notification

      1. System Policy | Notification
      2. Click New
      3. Click Advanced View
      4. Name it "Incident Impact Changes to 1"
      5. Make sure the table is set to incident
      6. Make sure the Type is set to "EMAIL"


      7. On the "When to send" tab, set the "Send when" to Record inserted or updated
      8. Check the inserted and updated checkboxes
      9. Conditions: Impact "is 1" or Impact is "less than or is 2"


      10. On the "Who will receive" tab, set Subscribeable to on


      11. On the "What it will contain" tab, fill in Subject and Message with variables and SMS alternate also



    3. Click on "My Profile" under Self Service
    4. Click on "Notification Preferences" Related Link
    5. By default you have "Primary Email" set up. You can click "New Device" to add your phone
    6. Click the green + button to subscribe to your notification and select "Incident Impact Changes to 1", pick your device and submit it.
    7. Create or update an incident with the impact 1
    8. Look at email logs to see emails sent under System Logs | Emails. The status of "send-ready" means it is going to send and "sent" status means it went out.





  2. Create Notification to be triggered from an event with a business rule

    1. Make sure outbound email is set up and working. See WIKI http://wiki.servicenow.com/index.php?title=Configuring_Email for this.
    2. Create and register a new Event

      1. System Policy | Events | Registry
      2. Name it something like "incident.impact.1"
      3. Make sure the table is set to incident
      4. Fill in the rest of the fields as desired



    3. Create a business rule similar to "Incident events" with the following script



    4. if (current.impact.changes() && current.impact == 1) {
      gs.eventQueue("incident.impact.1", current, current.impact, previous.impact);
      }


    5. Create New Notification

      1. System Policy | Notification
      2. Click New
      3. Click Advanced View
      4. Name it "Incident Impact Changes to 1"
      5. Make sure the table is set to incident
      6. Make sure the Type is set to "EMAIL"


      7. On the "When to send" tab, set the "Send when" to Event is fired
      8. Event name: choose your event that you created in step 2.


      9. On the "Who will receive" tab, set Subscribeable to on


      10. On the "What it will contain" tab, fill in Subject and Message with variables and SMS alternate also



    6. Click on "My Profile" under Self Service
    7. Click on "Notification Preferences" Related Link
    8. By default you have "Primary Email" set up. You can click "New Device" to add your phone
    9. Click the green + button to subscribe to your notification and select "Incident Impact Changes to 1", pick your device and submit it.
    10. Create or update an incident with the impact 1
    11. Look at email logs to see emails sent under System Logs | Emails. The status of "send-ready" means it is going to send and "sent" status means it went out.

8 Comments