Ms Teams popup on Incident Form

Vishwanath5
Tera Expert

Hello,

 

I have a custom recruitment to add Teams Button on incident form(caller field). which on click open then team chat available in the caller field. 

 

Vishwanath5_0-1688454248370.png

Vishwanath5_1-1688454524327.png

 

 

This is the UI Micro i have written..

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
 
<g:evaluate var="jvar_gr" object="true" > </g:evaluate> 
<!--class ="btn-default;" '${ref}'  reference-->
 
<a>
<img src="teamslogo.png" width="45%" height="45%" title="Popup Teams" alt="${gs.getMessage('click to open Teamns chat')}" id="${jvar_n}" onclick="invokeChat()"> </img>
</a>
 
<script>
function invokeChat(){ 
var user =  g_form.getReference('caller_id').email;
var firstname = g_form.getReference('caller_id').first_name;
var number = g_form.getValue('number');
var sd = g_form.getValue('short_description');
var subject = Hi  + firstname + ', this is regarding your incident ' + number + ':' +  sd;
 
var w = getTopWindow();
var url = prefix + user + subject;
w.open(url);
}
</script>
 
</j:jelly>
 
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Vishwanath5 

so what's the issue faced?

check this link

MS Teams Ui macro for Requested For field SCTASK, REQ, RITM 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Vishwanath5 

so what's the issue faced?

check this link

MS Teams Ui macro for Requested For field SCTASK, REQ, RITM 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Issue is, right now it not opening the Teams window when i clink on teams logo on incident form... 

 

I tried the above code (the link which you shared..) even that is not working .

@Vishwanath5 

the link I shared has working solution. not sure why it's not working.

Also did you check any browser console error is coming when you click that?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

yes i am getting an error 

Vishwanath5_0-1688456937655.png