Sai Kumar B
Mega Sage
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ā12-24-2021 10:36 PM
Hi All,
Today I have found an amazing undocumented API that outputs all logged-in user group sys_id(s). You can use this to reduce the amount of scripting š
You can try this in your Background script
gs.print(gs.getUser().getMyGroups())
Output :
Regards,
Sai Kumar
- 7,240 Views
Comments
Patrik Z
Giga Guru
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
ā08-29-2024
01:51 AM
Hi, yea but the the problem is the returned value is not an array.
Do you know what type of an object is returned?
Manolis Sgouro1
Tera Contributor
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
ā01-06-2025
12:48 AM
Paul Kunze
Tera Guru
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
ā04-23-2025
04:55 AM
You can easily convert the object to a comma-separated String like this:
var myGroups = JSON.parse(JSON.stringify(gs.getUser().getMyGroups())).toString();
Looks like overkill but works š
Robert H
Mega Sage
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello @Patrik Z , @Paul Kunze ,
An even easier way is to use this:
var myGroups = j2js(gs.getUser().getMyGroups()).toString();Regards,
Robert
