Field appearing as read-only on Agent workspace


Description

On an incident form, state field was appearing as read-only on workspace, the same field appears as editable on the native UI.



Release or Environment

Orlando release onwards

Cause

There was a incident.state/write ACL which had script condition with gs.getUrlOnStack() API.

This API was returning null on workspace and hence write ACL failed with below error, thus the state field was appearing as read-only on workspace.


12:50:19.925 [GraphQL Tracing] path=/GlideViewQuery_Query/uiView/glideLayoutItem/_query/GlideLayout_Query/formLayout/elementsData[3]/dictionary/sys_readonly, duration=0:00:00.001, sql_count=0

12:50:19.935 Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object. Caused by error in Access Control: 'incident.state' at line

Resolution

For the ACL to work on workspace, use "gs.action.getGlideURI().toString()" API instead of "gs.getUrlOnStack()" API.