HR Transfer Case Reclassify not working (Workaround)DescriptionAt ServiceNow we have "Unique" checked on the task table since we want to prevent duplicate numbers. This results in the Reclassify option not working. The "swapNumber"-function (in the hr_TransferCase script include) of ServiceNow calls the "setNumber"-function twice: - Once to set the new record number on the original record - the second to set the original number on the new record During the execution of this at one time the number is not unique and the unique check prevents this. Doing so results in the improper execution of the swapNumber function. Note: This issue is fixed in Quebec. You can consider the following workaround if you are on releases prior to Quebec. Test thoroughly in dev/test instance before applying to production.ResolutionFor a workaround the customer can edit the `ReclassifyCaseTransfer` and `hr_TransferCase` to use a temporary number while transferring and avoid a duplicate key issue.They can add a function `setNumber` in `hr_TransferCase`:setNumber: function (record, value) {var lePluginActive = GlidePluginManager.isActive("com.sn_hr_lifecycle_events");var leUtils = lePluginActive ? new sn_hr_le.hr_LETransferUtils() : '';if (lePluginActive && leUtils.isLECase(record))leUtils.setNumber(record, value);elserecord.number = value;},and call that in `ReclassifyTransferCase`, replacing lines 71-87 with:var originalNumber = String(grCase.number);transferUtils.setNumber(grCase, String(newRecord.number));// Use a temporary number to avoid unique key violationvar tempNumber = "TEMP00000000";transferUtils.setNumber(newRecord, tempNumber);newRecord.update();// Copy transfer-specific fieldsnewRecord.transferred_from = originalRecordSysId;grCase.transferred_to = newRecord.getUniqueValue();// Cancel original casegrCase.state = 7;if (!grCase.update()) {gs.addErrorMessage(gs.getMessage("Failed to close original case"));return;}// Copy original creation date & numbernewRecord.sys_created_on = grCase.sys_created_on;newRecord.number = originalNumber;newRecord.update();