Unique Key violation violation when inserting [sc_task], the sys_id of the record is a sys_id of a user recordIssue You have a business rule on [sc_req_item] where a sc_task is created when however we see the following occurring: 2022-04-14 09:30:06 (987) Default-thread-32 3631E5EA97F6C5D8AE9EB8A3F153AF19 txid=ba520aea97ba SEVERE *** ERROR *** FAILED TRYING TO EXECUTE ON CONNECTION glide.16 (connpid=2076006): INSERT INTO task (`parent`,`a_ref_1`,`short_description`,`made_sla`,`assignment_group`,`upon_reject`,`sys_updated_on`,`task_effective_number`,`sys_class_name`,`number`,`sys_id`,`sys_updated_by`,`opened_by`,`urgency`,`sys_created_on`,`sys_domain`,`u_most_recent_work_note`,`state`,`reassignment_count`,`sys_created_by`,`knowledge`,`approval`,`impact`,`due_date`,`sys_mod_count`,`active`,`a_ref_2`,`sys_domain_path`,`priority`,`u_latest_recent_comment`,`opened_at`,`a_bln_1`,`upon_approval`,`approval_set`,`a_str_1`) VALUES('ef992c6e97fa0510ae41361e6253afbf','2b992c6e97fa0510ae41361e6253afbf','Remove access now expired.',1,'aa672494dbf328147e7f64904b9619ba','cancel','2022-04-14 16:30:06','SCTASK0409407','sc_task','SCTASK0409407','7d8e796fdbdf58101d855275ca9619a4','cake.mappon@genUAT091.com','9f793da7db5f58101d855275ca961942',3,'2022-04-14 16:30:06','global',NULL,1,0,'cake.mappon@genUAT091.com',0,'not requested',3,'2022-04-15 00:02:22',0,1,'ef992c6e97fa0510ae41361e6253afbf','/',4,NULL,'2022-04-14 16:30:06',0,'proceed',NULL,'1') /* genUAT091, gs:3631E5EA97F6C5D8AE9EB8A3F153BC19, tx:ab520aea97ba09d8ae9eb8a3f153aee2 */ Unique Key violation detected by database ((conn=2076006) Duplicate entry '7d8e796fdbdf58101d855275ca9619a4' for key 'PRIMARY') java.sql.SQLIntegrityConstraintViolationException: (conn=2076006) Duplicate entry '7d8e796fdbdf58101d855275ca9619a4' for key 'PRIMARY' STEPS TO REPRODUCED- create a business rule on [sc_req_item] when "state" changes to "close incomplete"- use the following code: var task = new GlideRecord("sc_task"); task.initialize(); task.request = current.request; task.requested_for = current.request.requested_for.sys_id; task.cat_item = '2a187c051b74b890886897541a4bcb1e'; task.request_item = current.sys_id; task.short_description = "asdasdasdasdasdasdasdasd."; task.assignment_group = 'aa672494dbf328147e7f64904b9619ba'; task.insert(); - submit the Standard Laptop as admin user- reject the first approval - and try it again- eventually, you will get a unique key violation on inserting in sc_task with a sys_id of a sc_task record already there- however, you'll also notice the sys_id of that of a [sys_user] recordCause- the unexpected behavior is caused by the custom script where requested_for is being used to assign a user- the issue is that requested_for does not exist on sc_task table Resolution- remove the line where requested_for is being assigned a value where the newly created [sc_task] record is being created