{"record":{"id":"06286f6d5f9b63da","repo":"flowable/flowable-engine","slug":"the-identity-link-type-is-required-06286f","errorCode":null,"errorMessage":"The identity link type is required.","messagePattern":"The identity link type is required\\.","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"warning","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskIdentityLinkCollectionResource.java","lineNumber":79,"sourceCode":"            @ApiResponse(code = 201, message = \"Indicates the task was found and the identity link was created.\"),\n            @ApiResponse(code = 404, message = \"Indicates the requested task was not found or the task does not have the requested identityLink. The status contains additional information about this error.\")\n    })\n    @PostMapping(value = \"/runtime/tasks/{taskId}/identitylinks\", produces = \"application/json\")\n    @ResponseStatus(HttpStatus.CREATED)\n    public RestIdentityLink createIdentityLink(@ApiParam(name = \"taskId\") @PathVariable(\"taskId\") String taskId, @RequestBody RestIdentityLink identityLink) {\n\n        Task task = getTaskFromRequestWithoutAccessCheck(taskId);\n\n        if (identityLink.getGroup() == null && identityLink.getUser() == null) {\n            throw new FlowableIllegalArgumentException(\"A group or a user is required to create an identity link.\");\n        }\n\n        if (identityLink.getGroup() != null && identityLink.getUser() != null) {\n            throw new FlowableIllegalArgumentException(\"Only one of user or group can be used to create an identity link.\");\n        }\n\n        if (identityLink.getType() == null) {\n            throw new FlowableIllegalArgumentException(\"The identity link type is required.\");\n        }\n\n        if (restApiInterceptor != null) {\n            restApiInterceptor.createTaskIdentityLink(task, identityLink);\n        }\n\n        if (identityLink.getGroup() != null) {\n            taskService.addGroupIdentityLink(task.getId(), identityLink.getGroup(), identityLink.getType());\n        } else {\n            taskService.addUserIdentityLink(task.getId(), identityLink.getUser(), identityLink.getType());\n        }\n\n        return restResponseFactory.createRestIdentityLink(identityLink.getType(), identityLink.getUser(), identityLink.getGroup(), task.getId(), null, null);\n    }\n}\n","sourceCodeStart":61,"sourceCodeEnd":95,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskIdentityLinkCollectionResource.java#L61-L95","documentation":"REST request validation in TaskIdentityLinkCollectionResource.createIdentityLink: neither user nor group can be linked without a type (e.g. assignee, candidate), and the request body omitted the type field.","triggerScenarios":"POST /runtime/tasks/{taskId}/identitylinks with {\"user\":\"kermit\"} but no 'type' field.","commonSituations":"Omitting type assuming a default (there is none); custom UIs that only collect user/group; version drift where a wrapper library dropped the type field.","solutions":["Add a 'type' field (commonly 'candidate') to the request body","Check the Flowable REST docs for supported identity link types","Ensure your client wrapper always serializes the type field"],"exampleFix":"// before\n{\"user\": \"kermit\"}\n// after\n{\"type\": \"candidate\", \"user\": \"kermit\"}","handlingStrategy":"validation","validationCode":"if (!payload.type) {\n  throw new Error('identity link type is required, e.g. candidate');\n}","typeGuard":null,"tryCatchPattern":"try { ... } catch (e) { if (e.status === 400 && /identity link type is required/.test(e.body.message)) showFormError('Type is required'); else throw e; }","preventionTips":["Always include a 'type' field (usually 'candidate')","Keep a constant list of valid link types in client code","Cover payload shape with unit tests"],"tags":["rest","validation","flowable","identity-links"],"backgroundTag":"missing-required-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T16:30:33.424Z"}