Teams Macro showing message Twice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 05:24 AM
I have created UI Macro for teams integration it is working fine but whenever click the web teams app then it is showing message twice and whenever click the teams app then working fine
UI Macro script :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2024 09:33 PM - edited ‎09-22-2024 09:35 PM
Hi Siva,
Here is a revised code:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide">
<a class="btn-default" id="${jvar_n}" onclick="invokeChat('${ref}'); return false;">
<img src="teams.png" width="30" title="Teams Chat" alt="${gs.getMessage('Click to open Teams chat')}" />
</a>
<script>
function invokeChat(reference) {
var prefix = 'https://teams.microsoft.com/l/chat/0/0?users=';
g_form.getReference('caller_id', function(caller) {
var firstname = caller.first_name;
var user = caller.email;
var subject = '&message=Hi ' + firstname + ', this is regarding your Incident ' + g_form.getValue('number') + ': ' + g_form.getValue('short_description');
var url = prefix + user + subject;
var w = getTopWindow();
w.open(url, '_blank');
});
}
</script>
</j:jelly>
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2024 11:25 PM
Hai @Akash4 I have tried with ur code but I have not Abel to save the code it is showing error message like below
The reference to entity message must be end with ; delimiter