Symptom
- An error occurs when trying to update the jobRoleEntity in a Job Requisition through OData API.
- Error message: "The given jobRole is not associated with the jobCode. Provide a jobCode associated with the given jobRole. with the index 0"
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
SAP SuccessFactors Recruiting Management
Reproducing the Issue
- Try to update the jobRoleEntity in a Job Requisition using OData API
- An error is received: "The given jobRole is not associated with the jobCode. Provide a jobCode associated with the given jobRole. with the index 0"
Sample request:
{
"__metadata":{
"type":"SFOData.JobRequisition",
"uri":"JobRequisition(1234)"
},
"isDraft": true,
"jobRoleEntity" :{"externalCode" : "1234567"}
}
Sample response:
{
"d": [
{
"key": null,
"status": "ERROR",
"editStatus": null,
"message": "The given jobRole is not associated with the jobCode. Provide a jobCode associated with the given jobRole. with the index 0",
"index": 0,
"httpCode": 400,
"inlineResults": null
}
]
}
Cause
The system checks if the new Role is associated with the Job Code in the Job Requisition. If there is no association, the error will be returned.
When the jobRoleEntity is provided in the request, the system will not automatically pull the associated Job Code into the job requisition details. This is an expected behavior.
Resolution
To update the Role in a Job Requisition using OData API, please provide both the jobRoleEntity and the jobCode. Ensure that the Role is associated with the Job Code.
Sample request:
{
"__metadata":{
"type":"SFOData.JobRequisition",
"uri":"JobRequisition(1234)"
},
"isDraft": true,
"jobCode": "1111",
"jobRoleEntity" :{"externalCode" : "1234567"}
}
See Also
User assistance documentation links:
Keywords
2H2024, RCM, Job Requisition, OData API, jobRole, jobRoleEntity, externalCode, Job Profile, Error , KBA , LOD-SF-RCM-API , Webservices & APIs , LOD-SF-RCM-JOB , Job Postings & Requisitions , LOD-SF-RCM-INT , Integration Center & Intelligent Services , Problem