- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2018 02:55 AM
Hello,
I want to restrict the edit button in the related list of incident available on the Problem form.
For user with “problem_requester” role the edit button should only appear when the state is “New”. For the rest of the users with role like Problem_manager, admins it should be visible all the time. I have tried to edit the list control but it is not working as it should be.
Edit roles added in the list control:
Scripts in omit edit condition:
wherein 1 is a value of New.
But the problem is servicenow considers only first condition “parent.state != '1' “ and ignores “gs.hasRole('problem_requester')” resulting access restriction for the admins as well when state is not new.
Please help to resolve this issue.
Thanks & regards,
Jainil Shah
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2018 03:03 AM
Try this
if ((parent.state==1 && gs.hasRole('problem_requester')) || gs.hasRole('admin') || gs.hasRole('problem_manager')){
answer = false;
}else
{
answer = true;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2018 03:03 AM
Try this
if ((parent.state==1 && gs.hasRole('problem_requester')) || gs.hasRole('admin') || gs.hasRole('problem_manager')){
answer = false;
}else
{
answer = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2018 03:08 AM
Id suggest that you dont use Edit Roles, put everything in the Omit Edit Conditions. That would give you more control.