- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 07:41 AM
Hi All,
Is there any js-function to get the user list object by group-name or is there any script to get all users from a group?
example group name is: IS&T Senior Leadership Team
Thanks & Regards,
Kiran Pedduri
Solved! Go to Solution.
- 29,664 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 08:15 AM
Hi Kiran,
Sorry, I had an error in the first one. I was pushing the sys_id of the membership record, not the users. I've corrected it.
Easy change... You can 'dot-walk' to get that. If you want the user_name field (labeled User ID, like chuck.tomasi) you can change the answer.push() line to this
answer.push(mem.user.name.toString()).
You want the email,answer.push(mem.user.email.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 10:20 PM
Got it thank you
Can I know why the same is not working to open group chat, please find the macro code as below,please suggest
<g:evaluate var="jvar_guid" expression="gs.generateGUID(this);"/>
<j:set var="jvar_n" value="show_incidents_${jvar_guid}:${ref}"/>
<g:reference_decoration id="${jvar_n}" field="${ref}"
onclick="invokeChat('${ref}');"
title="Invoke Chat1" image="lync.jpg"/>
<script>
function invokeChat(reference) {
var s = reference.split('.');
var tableName = s[0];
var referenceField = s[1];
var v = g_form.getValue(referenceField);
var emails = [];
var mem = new GlideRecord('sys_user_grmember');
mem.addQuery('group.name', 'v');
mem.query();
while (mem.next()){
emails.push(mem.user.email);
}
var i = emails.length;
while(i-1){
var url = 'sip:' + emails[i];
var w = getTopWindow();
w.open(url);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2018 06:29 PM
is variable v contains sys_id or name,
if it has sys_id then use:
mem.addQuery('group', v); //Remove quotes from v
if it contains group name then use,
mem.addQuery('group.name', v); //Remove quotes from v
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2018 10:16 PM
Hi Shishir, OK. it is working fine . Can i know how to open group chat as i opened here single window by using "var w = getTopWindow();' but how to open group window is there any property for that
<g:evaluate var="jvar_guid" expression="gs.generateGUID(this);"/>
<j:set var="jvar_n" value="show_incidents_${jvar_guid}:${ref}"/>
<g:reference_decoration id="${jvar_n}" field="${ref}"
onclick="invokeChat('${ref}');"
title="Invoke Chat1" image="lync.jpg"/>
<script>
function invokeChat(reference) {
var s = reference.split('.');
var tableName = s[0];
var referenceField = s[1];
var v = g_form.getValue(referenceField);
var emails = [];
var mem = new GlideRecord('sys_user_grmember');
mem.addQuery('group.name', v);
mem.query();
while (mem.next()){
emails.push(mem.user.email);
}
var i = emails.length;
while(i-1){
var url = 'sip:' + emails[i];
var w = getTopWindow();
w.open(url);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 07:47 AM
Hi Kiran,
You can use the 'sys_user_grmember' table for that.
Just like this:-
var grMembr = new GlideRecord('sys_user_grmember');
grMembr.addQuery('name','IS&T Senior Leadership Team');
grMembr.query();
This will give your desired records you can iterate through them to implement your desired functionality.
please mark my reply as "Helpful/Correct Answer" Or Like if helpful.
Regards,
Saikiran Guduri.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 08:54 PM
Hi ,
Can anyone tell me how to get the list of watch list members and display the
first name of watch list member.
in email template as- Dear "insert first name of watch list member",
*** this is the code i have but its wrong as watch list members are multiple
(function executeRule(current,previous){
var gr = new GlideRecord("u_support_management");
gr.addQuery('active',true);
gr.query();
if (gr.next()) {
var firstName= gr.watch_list.first_name.getDisplayValue();
template.print(firstName);
}
return '';
})(current,previous);
Thank You,