Symptom
How can I retrieve the Job Requisition current status via OData API?
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
- Job Requisition;
- OData API;
Resolution
There are two Job Requisition statuses:
- The status of the Job Requisitionis currently in: Pre-Approved, Approved and Closed
To get the first Job Requisition status, you need to go to the Data Dictionary and search for the internalStatus, which is the field that represents in the API the current status of the Requisition. As an example I am selecting the Job Requisition Id and the Status, your query should look like this:
[YOUR_DC_URI]/odata/v2/JobRequisition?$select=jobReqId,internalStatus
The response for this Query will look like the below image:
- The status that you select in the Job Requisition, which you can configure to set what you want in the picklist reqStatus
Now, to get the status selected in the picklist reqStatus from the Job Requisition, search for the field status in the Data Dictionary that you can see that is a picklist field. The query created as an example is selecting the Job Requisition Id and the Label of the picklist:
[YOUR_DC_URI]/odata/v2/JobRequisition?$select=jobReqId,status/localeLabel&$expand=status
The response for this query will look something like this:
One interesting thing to notice is that to get the value from the picklist, we need to use the $expand operator in the query, to be able to get the values from the picklist such as the label and the id of the picklist. Another important thing to know is that if you don't use it, even if the picklist field is set in the $select operator, no value will come in the response from this query.
Keywords
Job, Req, Requisition, Status, picklist, OData, query, $select, $expand, internalStatus