How to send message with incident update details from ServiceNow toTeams

Haceena Shaik
Tera Expert

Hi Team,

We have implemented, ServiceNow for teams integration.

We need to execute following Use case:

 -> When ever there is an update in incident, an incident post details has to be sent dynamically to caller/assigned to of that incident. (As message chat to teams.)

Please let us know the best approach and do needful.

Regards,

Haseena

 

 

8 REPLIES 8

Hi,

Apologies, I do not know much about virtual agent integration with Teams. I did implementation by using those OOTB Teams spokes.

Hopefully someone else might help you.

Thanks and Regards,
Abhijit
Community Rising Star 2022

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

Ian Mildon
Tera Guru

While I cannot comment on using the Teams integration, I do know it is possible to create a Teams conversation with single user from ServiceNow.

I created a UI Macro that is called from a field attribute that, when clicked will open a new Teams message to the "caller_id" user of the Incident. And while you probably don't need the UI Macro script itself, you might find the <script> section useful:

 function invokeChat(reference) {
    var prefix = 'https://teams.microsoft.com/l/chat/0/0?users=';
    var firstname = g_form.getReference('caller_id').first_name;
    var user = g_form.getReference('caller_id').email;
    var subject = '&amp;amp;message=Hi ' + firstname + ', this is regarding your Incident: ' + g_form.getValue('number') + ', Short Description: ' + g_form.getValue('short_description');

    var w = getTopWindow();
    var url = prefix + user + subject;
    
    w.popupOpenFocus(url, 950, 1000, '', false, false);
 }

Hey,

This looks interesting, I tried your code and it opens new window in Teams. 

However, It asks me to select user to send message to. Would you mind providing one example where we can successfully send a message to individual user via any action from ServiceNow?

Thanks and Regards,
Abhijit
Community Rising Star 2022

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

If it is asking you to select a user, then it is not building the "url" variable correctly for your situation.

This Microsoft page might prove useful: Create deep links