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

Kieran Anson
Kilo Patron

I'm not aware of canCreate accepting a script, only a boolean value. Do you have documentation for this?

No, but it was something suggest by copilot.  how will you have resolved this issue. to block one group from creating.

 

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.

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