Engage with xMatters (ServiceNow) - Business rule to update work notes

Not Yet Reviewed

Hi There,

We're currently working on publishing the Engage with xMatters integration to our ServiceNow instance for a pilot program within our IT department. 

My management has a couple concerns with the way the integration works and I was wondering if someone would be able to help me with them.

Basically, the integration currently doesn't update the actual incident with any information, only adds related "xMatters Engage" records and notes changes in the worknotes of those records. I would like, if possible, to add worknotes to the actual incident that was Engage'd, at the very least that someone has acknowledged the notification and is now taking over the incident.

Additionally, our servicenow usernames are different from the xmatters usernames. When the integration posts work notes, it uses the xmatters username, which is simply a number and is not very useful to people viewing the ticket. I would like to be able to map this to a person's name if at all possible. 

finally, a "nice to have" would be to automatically assign the incident to the person who acknowledged the Engage notification. I assume if it is possible to map the actual user's name and put worknotes that they have acknowledged the notification, it should be relatively straightforward to assign the incident to that person as well. 

Let me know if you have any strategies/advice on how to set up something like this. Thanks!

0

Comments

5 comments
Date Votes

Please sign in to leave a comment.

  • Hi Travis,

    Thanks for getting back to me so quickly, apologies I've let this sit for a week. We are on version 4:

    "Installed Version 4.0.2"

     

    0
  • Hey Andrew!  Good to know. That is the latest and greatest or at least close enough for our purposes. 

    I have outlined some things that might work, but if you aren't terribly comfortable with scripting and coding on the ServiceNow platform, I'd recommend finding someone to help you. We have some field consultants who could be tapped for such things, if you don't have access to a ServiceNow developer already.

    1) Engage work notes to the Incident work notes: I don't have an environment I can test this in just yet, but in looking through code, this is an easy thing that might work. Get into the "Engage with xMatters - Outbound Response" Outbound Integration in the Integration Builder in the ServiceNow comm plan and change the "engage" to "incident":
    var response = xmServiceNowClient.sendResponseCallback('engage', callback);
    That will point the callback to the "xm/incident" Scripted REST Endpoint which handles the Incident updates. One draw back I see to this is that it would be hard to determine what work log entries came from Engage and which ones came from a targeted Incident. We'd probably need to pass an additional field or a flag or something for the Scripted REST Endpoint to evaluate to change the note to clarify it is an Engage "activity".

    2) Mapping the xMatters username to a full name: I don't suppose the user's xMatters username is stored in ServiceNow? If so then we could just do a GlideRecord query to retrieve the full name from the sys_user record in SN. Otherwise, you'd have to do a web services call into xMatters to the /api/xm/1/people/{username} to get the fullname of the user.


    3) Assigning the incident to a user from an engage event: Is there anywhere you have the xMatters username and the ServiceNow username together? We'd need a place we can query to get the ServiceNow username so we can set the value in the Incident. On the xMatters side, there are custom fields that can hold this kind of information, but you'd need to get it populated. Once you had it populated, then a web service call to the /api/xm/1/people endpoint will return it.


    All of these are on the more complicated end of changes to the integration, so I would highly recommend some assistance from someone who is very familiar with ServiceNow development work, or one of our field consultants. They are pretty familiar with making extensive changes to the integrations and would be able to help out.

    I hope that gets you a start. Let me know if you have further questions.
    Happy Tuesday!
    --- Travis

    0
  • Hi Travis,

    I found and updated the URLs you mentioned, it's working great. It might be a little noisy but I believe its exactly what my management is looking for. 

    Our ServiceNow users use network account usernames, and the xMatters users have their employee numbers as their usernames. We have the employee numbers in ServiceNow, it would be a simple query on the user table. Where should I slide that in to look it up? For what it's worth, I've already configured USERNAMEFIELD in the xMatters Properties script include to map the users for the other Incident notification, so perhaps if we queried based on that, this could be included in a patch to Engage!

    0
  • Nice. Good to hear! The work notes are built in the Scripted REST Endpoint, so if you are now pointing to the xm_incident endpoint, you'll see a call to the xMattersCallback getWorkNotes function. Inside that function you'll do the look up to sys_user to get the full name. The this.params.recipient is the xMatters username, which sounds like will be the employee number. 

    I think you also might need to change the response options available on your Engage notifications, to add "Assign to me" to trigger the assignment. 

    Let me know how that goes!

    0
  • Awesome! Thanks for circling back. Glad you got it sorted out. 

    0

Didn't find what you were looking for?

New post