- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 03:13 AM - edited 04-18-2024 03:25 AM
Hello experts,
I want to create a scripted filters on user table for showing user which having the "Itil" role.
I have taken the help from https://docs.servicenow.com/bundle/washingtondc-platform-user-interface/page/use/using-lists/task/t_...
I created below script include:
Please help on that.
Thank You!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 04:52 AM - edited 04-18-2024 04:54 AM
Hi @Chandra18 ,
Please Remove all the content of the script and just keep below script or your script will also work
function myFunction(){ var arrUsers = []; gr = new GlideRecord('sys_user_has_role'); gr.query('role', '282bf1fac6112285017366cb5f867469');//itil role sys_id while (gr.next()) { arrUsers.push(gr.user.toString()); } return arrUsers; }
If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 04:19 AM - edited 04-18-2024 04:56 AM
Hi @Chandra18 ,
Could you please elaborate more on what you're trying to do and what issue you're facing?
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 04:50 AM
I want to achieve as below attached video but my condition is "user which having the "Itil" role on user table."
https://youtu.be/rcwq6pvN-kE?si=q9bf_TZKF8ySH50z
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 04:52 AM - edited 04-18-2024 04:54 AM
Hi @Chandra18 ,
Please Remove all the content of the script and just keep below script or your script will also work
function myFunction(){ var arrUsers = []; gr = new GlideRecord('sys_user_has_role'); gr.query('role', '282bf1fac6112285017366cb5f867469');//itil role sys_id while (gr.next()) { arrUsers.push(gr.user.toString()); } return arrUsers; }
If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 09:15 PM
Hi @Astik Thombare
Please provide below line again, give role by properties without hardcoded.
gr.query('role', '282bf1fac6112285017366cb5f867469');