- 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-22-2021 01:49 AM
Hi,
Thanks for your answer...but can i get this list in the sorted by descending order of created on date? what will be this changed to?
var url = gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + 'incident' + '_list.do?sysparm_query=' + 'assignment_group=287ebd7da9fe198100f92cc8d1d2154e';
- 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
‎06-16-2022 05:50 AM
iam not getting o/p for my requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2024 04:10 AM
Hi Ankur ,
Your above code works fine for me,
but i don't need to see full URL instead 'click here' if i click it should take to there. how can i achieve this
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2024 05:18 AM
can you post a new question and tag me there as this is an old thread?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader