service operation workspace

Cherly
Tera Contributor

I want to block one group from see the create problem button from incidents or to stop the button from working.  i create this script but is working all user 

"label": {
"translatable": true,
"message": "New Problem"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "problem",
"sysId": "-1"
},
"multiInstField": ""
},
"condition": {
"tableDescription": {
"table": "problem",
"canCreate": 
 {
        "script": "!(gs.getUser().isMemberOf('SD_SVCDESK_ALL'))"
      }
2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@Cherly 

you can't use script for this at that place

Handle this using Table.None CREATE ACL and use script there

If user doesn't pass CREATE ACL then new button will be hidden automatically

answer = !gs.getUser().isMemberOf('SD_SVCDESK_ALL');

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Looks like Copilot was hallucinating. The only way to restrict this is via a create ACL or defining the roles which are allowed to see the action.

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Cherly 

please share screenshot where is this in workspace

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Cherly_0-1761666638580.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Cherly 

if this is about OOTB UI Action then add the condition there

AnkurBawiskar_0-1761666246124.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader