UI macro redirect to teams chat window is not working for NEW TEAMS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 04:23 AM
Hi All,
I have existing UI Macro Script to redirect MS teams chat window and its working fine with Classic Teams but recently we have upgraded to NEW MS TEAMS. the below existing script was not working for NEW MS TEAMS. Could you please help me on this?
Thanks & Regards
Nataraj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 04:46 AM
I don't see any issue in this. Try changing the URL with these two and see any one of them fixes your issue:
var url = 'https://teams.microsoft.com/l/chat/0/0?users=' + emailID + '&message=Hi ' + firstname + ', this is regarding your Incident ' + nm + ': ' + sd + ' ';
or
var url = 'https://teams.microsoft.com/l/chat/0/0?users=' + emailID + '&message=Hi ' + firstname + ', this is regarding your Incident ' + nm + ': ' + sd + ' ';
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2024 07:16 AM
@palanikumar
thanks for your suggestion, But its not working! still same issue was happing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2024 08:04 AM
<?xml version="1.0" encoding="utf-8" ?>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2025 09:00 AM
Not sure if anyone got an answer but this worked for me
<?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_guid" expression="gs.generateGUID(this);" />
<j:set var="jvar_n" value="teams_chat_${jvar_guid}:${ref}"/>
<a id="${jvar_n}"
class="ref-button btn btn-default btn-ref"
style="padding:5px 6px 7px; visibility:hidden;"
onclick="invokeChat('${ref}');">
<img border="0"
src="Microsoft_Teams_16x16.png"
title="Teams Chat"
alt="${gs.getMessage('Click to open Teams chat')}" />
</a>
<script>
function invokeChat(reference) {
var prefix = 'msteams:/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;message=Hi ' + firstname + ', this is regarding your Incident ' + g_form.getValue('number') + ': ' + g_form.getValue('short_description');
var w = getTopWindow();
var url = prefix + user + subject;
w.open(url);
}
// show/hide button based on field value
function decorationShow(element, original, changed, loading) {
var visibility = 'hidden';
if (changed.length > 0) {
var parentTr = gel('element.' + element.id);
if (!(parentTr $[AMP]$[AMP] parentTr.style.visibility == 'hidden'))
visibility = 'visible';
}
var e = gel('${jvar_n}');
e.style.visibility = visibility;
}
// handle the onchange event
var n = '${ref}'.replace(/\./g, '_');
var h = new GlideEventHandler('onChange_' + n, decorationShow, '${ref}');
g_event_handlers.push(h);
</script>
</j:jelly>