Script include for ui action

DeepikaR1661877
Tera Contributor

Hi all,

I have one requirement

1.

when the user having the "abc" role then the assignment group also having the same role then only user can able to see the escalation UI action , i have write the script for that , it's working bit when i m impersonating the user who having the "abc" role & the assignment group doesn't having the role even though they can able to see the ui action , how can i restrict when the group doesn't have the role?

 

checkActionableUIActionVisibility: function(sirRecord) {
if (gs.hasRole('abc')) {
var userSysId = gs.getUserID();
if (sirRecord.assignment_group && sirRecord.assignment_group == gs.getUser().getGroupID()) {
return true;
} else if (sirRecord.assigned_to && sirRecord.assigned_to == userSysId) {
return true;
}
}
return false;
}

5 REPLIES 5

Mark Manders
Mega Patron

Since you created the same question again, you don't want any more answers on this one (https://www.servicenow.com/community/developer-forum/script-include-for-if-current-logged-in-user-in...). Please close this question and follow up on your new one. It would also be very helpful when creating the same question again, to include the answers that were already given and explain what didn't work, so you don't get the same answers twice.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark