Allow users with specific role to edit Impact and Urgency
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 03:08 AM - edited ‎12-04-2024 10:45 PM
Impact and Urgency fields in incident form is read - only. If user has a specific role, then he/she should be able to edit the impact and urgency so that priority gets altered. Please help me how I can achieve this.
Note: User should be able to change the two fields even after the form is submitted/saved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 03:14 AM
Hi @Keerthana chama ,
Create filed level ACL for both filed and use below code.
// Allow access if the user has the specific role
if (gs.hasRole('itil_admin')) { // replace with your role
answer = true;
} else {
answer = false;
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2024 01:11 AM
Hi @Runjay Patel ,
Thank you for the reply!
I tried this but didn't work. I investigated and found one OOTB UI policy which is making Urgency and Impact read-only.
I have made changes to the script by adding the role in one of the conditions in the script and now I achieved my requirement this way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2024 03:11 AM
Hi @Keerthana chama ,
UI Policy is not the right solution for this as user may try to change from list view. anyway if you are going with UI policy then use below code. Do not put any condition for ui policy just add below script.
function onCondition() {
var role = g_user.hasRole('itil_admin');
if (role) {
g_form.setReadOnly('impact', false);
g_form.setReadOnly('urgency', false);
} else {
g_form.setReadOnly('impact', true);
g_form.setReadOnly('urgency', true);
}
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 01:59 PM
And what is your question? Above is not a question - just a statement ?
if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Best regards
Anders
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/