Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

MS team icon in the incident form

Thomas98
Tera Expert

Hi,

 

I created MS Teams incon next to the the caller in the incident form. Using the below script. It works great, but during the testing what i found was Sub category in the incident form remains "none" when I deactivate the UI macro for MS team icon, subcatefgory started to work. 

 

Can someone please help me decode this? 

 

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
 
<a class="btn-default;" id="${jvar_n}" onclick="invokeChat('${ref}');">
<img src="ms_team.png" width="30" height="30" title="Teams Chat" alt="${gs.getMessage('Click to open Teams Chat')}"/>
</a>
 
<script>
 
function onChange(element, original, changed, loading) {
var visibility = 'visible';
var sysID = g_form.getValue('assigned_to');
if (!sysID)
visibility = 'hidden';
 
var e = gel('${jvar_n}');
e.style.visibility= visibility;
}
 
function invokeChat(reference) {
  var number = g_form.getValue('number');
  var short_desc = g_form.getValue('short_description');
  var s = reference.split('.');
  var tableName = s[0];
  var referenceField = s[1];
  var v = g_form.getValue(referenceField);
  var email;
  var gr = new GlideRecord('sys_user');
  if (gr.get(v)) {
    email = gr.email;
firstName = gr.first_name
  }
 
  var url = 'msteams:/l/chat/0/0?users=' + email + '&amp;amp;message=Hi ' + firstName + ', this is regarding incident: ' + number + ' - ' + short_desc; 
  
var w = getTopWindow();
w.open(url);
 
}
 
 
</script> 
</j:jelly>
0 REPLIES 0