Excluding users in a notification.

trmiller0805
Kilo Explorer

We recently spun off from another company and until all systems are separated, our service desk has some double duty.   All of our employees at the new company are calling the new Service Desk but if they need something done that is still on the old company infrastructure (we will still be migrating things for a couple more months) a ticket has to be opened in the old company service now and assigned to the right person.   We don't want our users getting notifications from the other system because they are calling our service desk and we want all notifications to be branded with our company info.   So, the Service Desk has access to both systems and will actually be opening an incident in both systems.   The end user will get notifications from our system even though the ticket is worked in the other system.   Once the ticket is closed on the other company side our company's Service Desk tech will put the notes in our ticket which will fire off the correctly branded notification to the end user.   Hope that all makes sense, it's kind of convoluted.   I was talking with someone and we came up with trying to add a script to the notification that will only send notification if the company = ONEOK (which is the old company) but not send notification if the user's company = ONE Gas


All I did was add this to the incident notifications (opened and closed)


    answer = ifScript();

 

    function ifScript() {

    var user = g_form.getReference('caller');

          if (user.company == 'ONEOK') {

                return 'yes';

          }

          return 'no';

    }

   


5 REPLIES 5

Subhajit1
Giga Guru

Hi Tracy,


Why do not you divide these two set of Users into two Specific Groups depending on their Companies and then send the Email Notifications accordingly. You can include the names of the Groups accordingly in the Email Notifications according to your need.



Thanks,


Subhajit


We are talking about hundreds of users and the 'old company' would rather not have to duplicate all groups in order to have a oneok and a one gas group for every group.   Plus, we felt if we were able to say ONLY send to ONEOK employees we wouldn't miss any via group maintenance.


Aaron40
Kilo Guru

Hi Tracy,



I like your approach. Sometimes the best solution is simply adding a flag field (but it looks like you already have the company field there). I'd just put a condition around the notification to fire only for the appropriate company like you've already suggested.


I would agree with Aaron on this; you should be able to accomplish this by setting a condition of Caller.company is ONEOK.   Essentially what you've done with your script, but simpler to maintain.



Good Luck!