- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2021 02:37 AM
Hi ,
i'm able to get the URL of user in following way in background script
======================================
var gr = new GlideRecord('sys_user');
gr.get(gs.getUserID());
var url = gs.getProperty('glide.servlet.uri') + gr.getLink(false);
gs.info(url);
===========================================
output:-
https://dev100338.service-now.com/sys_user.do?sys_id=6816f79cc0a8016401c5a33be04be441&sysparm_stack=sys_user_list.do?sysparm_query=active=true
======================================================================
In a similar way,i need to GlideRecord "incident" table and sort the records which is assigned to network team and get list URL of all records assigned to that team.
var gr = new GlideRecord('incident');
gr. addEncodedQuery('assignment_group=287ebd7da9fe198100f92cc8d1d2154e') ;
gr.query();
var url = gs.getProperty('glide.servlet.uri') + gr.getLink(false);
gs.info(url);
output:here i'm not getting the link of records list view 😕
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2021 01:57 AM
Hi,
yes do this
var url = gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + 'incident' + '_list.do?sysparm_query=' + 'assignment_group=287ebd7da9fe198100f92cc8d1d2154e' + '&sysparm_order=sys_created_on&sysparm_order_direction=desc';
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2021 02:48 AM
Hi,
use this
var gr = new GlideRecord('incident');
gr. addEncodedQuery('assignment_group=287ebd7da9fe198100f92cc8d1d2154e') ;
gr.query();
while(gr.next()){
var url = gs.getProperty('glide.servlet.uri') + gr.getLink(false);
gs.info(url);
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2021 09:08 AM
Hope you are doing good.
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2021 10:31 AM
Hi Ankur,
this will generate individual URL's of records..I need single URL of complete records assigned to particular team.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2021 08:10 AM
Hi,
then do this
var url = gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + 'incident' + '_list.do?sysparm_query=' + 'assignment_group=287ebd7da9fe198100f92cc8d1d2154e';
gs.print(url);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader