Conditions for the error to happen:
-Variable has to be defined on the item directly. Similar variables inside Variable Sets do work correctly. Wrapping the variable in a container doesn't help.
-Variable has to be Multi Line Text. Other types work, such as Single Line Text.
-Variable has to be read-only by means of Write Roles defined on the variable. (and possibly other methods)
-The RITM form needs to be viewed by a user who has the variable set read-only by the write-role.
Steps to Reproduce
- Login in to an instance on the Dublin version of Servicenow.
- Create a Catalog Item.
- Add a new Multi line text variable to it named var_1.
- Set this variable with Write Roles=admin, to make it read-only to non-admin users.
- Create a Client Script on Task to run the following:
- Order the catalog item, leaving the variable blank.
- Impersonate a non-admin user.
- View the RITM you just ordered in a form, in default view, so the variable editor is on the form.
Result: The variable should be hidden, but it is not.
Try any of the following workarounds:
- Use Single Line Text instead of Multi line text
- Do not set the field read-only, but simply hide it instead
- Move the affected variables into a Variable Set
The last option is the preferred workaround. With this option, all you need to do is create a variable set and point the variable to this instead of the catalog item. If the variable set has the same order set as the item and is then added to the catalog item, nothing will have changed from the point of view of the variable sys_id, or how it is subsequently used and displayed to the user. This option also does not break any existing RITMs as the sys_id of the variable remains the same.
Related Problem: PRB628304