How to hide SLA field for non-admin users when stage changes to cancelled?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 11:40 PM
So that only admin users can view SLA details at the stage when an incident is cancelled.
What would be the best solution to achieve this? Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 04:33 AM
Hi @KarolisM
But why to hide from NON admin? ITIL users are actually users who should know these status of SLA.
You can do via Client script but I will not recommend.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 05:53 AM
Hi @KarolisM ,
You want to hide the entire Task Sla section for non admin user when incident state is cancelled ?
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 06:03 AM
That is correct @swathisarang98
With the possibility to unhide it if the user would like to see it again.
What kind of script I would need to use to achieve it. I have tried several options which haven't been successful. Including Client Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 01:13 PM
i created a onload script you can write fro onchange aswell with same code , but if user dont have admin role it will hide the entire Related list ,
function onLoad() {
if (g_form.getValue('state') == '8')//chceking state is cancelled
{
var userRole = g_user.hasRole('admin');//checking role is admin or not
alert(userRole);
if (userRole == 'false' || userRole == false) {
g_form.hideRelatedLists('task_sla.task');//hide related list
}
}
}
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang