Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

@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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

@Vishwanath5 

it seems you are using wrong field name in getReference()

please ensure you use correct field name

var user = g_form.getReference('caller_id').email;
var firstname = g_form.getReference('caller_id').first_name;

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

Issue is fixed thanks a lot @Ankur Bawiskar 

@Vishwanath5 

Glad to know.

Please mark my response as correct and close the thread.

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