Unable to submit a Service Contract


Description

When trying to create a Service Contract (Contracts - Service Level Management Menu Option) Customer is able to input the necessary data such as start & end dates, financial and supplier details, however when trying to submit for review an error message is generated [unique key violation detected by database].

Release or Environment

Paris

Cause

Custom business rule that calls a custom script include rule which is doing additional security checks. Specific user profile is missing something that the custom script include is checking for.

Issue doesn't occur for maint/admin

Resolution

The error displayed is usually generated by a custom business rule with current.update() in the code.

Noticed that new contract records were actually created even though the error was thrown.

No new records are displayed when impersonating the user but when I stopped impersonating and opened the service contracts table list view, I could see new records were added.
I initially thought this could be ACLs but security debugging didn't show any missing/failing ACLS.
I checked and the user has the required roles.

Reproduced the issue with debug tools to see what business rules execute when the error occurs.
The debug shows this business rule executes.
UP3 Contract Query Rule
https://instance.service-now.com/nav_to.do?uri=sys_script.do?sys_id=5e61b591db062700e1c41cd74b96191e

The business rule calls this Script Include
UP3ContractSecurityManager
https://instance_name.service-now.com/nav_to.do?uri=sys_script_include.do?sys_id=f3276599dbc22700e1c41cd74b9619dc
Script Include that contains functions for controlling the security of contracts for Cox.

This custom configuration seems to be doing additional security checks and the users profile is missing something that the custom script include is checking for.

To test, I disabled this business rule and the error no longer displays and the contract records are all displayed in the Service contracts list. (while impersonating the affected user)