Hi everyone..I have written ACL for restricting write access on incident state field so that this field should be accessible only if state is not one of 'Resolved', 'Closed' or 'Cancelled' and logged in user is a member of 'Assignment Group'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2015 06:21 AM
Hi everyone..I have written ACL for restricting write access on incident state field so that this field should be accessible only if state is not one of 'Resolved', 'Closed' or 'Cancelled' and logged in user is a member of 'Assignment Group'. For some reason, it is not working as expected. Below is the screenshot for same.
Also please note that I have actually changed an existing one so at field level I guess there should be no issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2015 08:13 AM
Also you may need to use current.assignment_group.getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2015 04:16 AM
Hi Gurpreet..Thank you. I tried both your suggestions it does not seem to work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2015 08:26 AM
Hi Shaveta,
Please try this
checkIfMember();
function checkIfMember(){
var current_user = gs.getUser();
return current_user.isMenberOf(current.assignment_group.name);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2015 04:14 AM
Guyss, I have edited the script to following. I dont think script has an issue.
answer= checkIfMember();
function checkIfMember()
{
var current_user= gs.getUser();
return current_user.isMemberOf(current.assignment_group.getDisplayValue());
}
However the script is not letting anyone edit this field even when state value is less than resolved.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2015 04:19 AM
Try the below script and let me know if it works.
{
var grp = current.assignment_group.name;
gs.log(grp);
return gs.getUser().isMemberOf(grp);
}