The Zurich release has arrived! Interested in new features and functionalities? Click here for more

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'

shaveta
Mega Expert

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.acl_state.png

25 REPLIES 25

Also you may need to use current.assignment_group.getDisplayValue()


Hi Gurpreet..Thank you. I tried both your suggestions it does not seem to work


manikumar
Kilo Contributor

Hi Shaveta,



Please try this



checkIfMember();


function checkIfMember(){


  var current_user = gs.getUser();


  return current_user.isMenberOf(current.assignment_group.name);


}


shaveta
Mega Expert

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.


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);


}