need some help troubleshooting the /api/v2/wfm/schedules/adherence endpoint. it returns null for agents who completed a shift swap on friday, even though the swap was approved and published. the api version is 1.0 and we are in america/chicago timezone. any ideas why the adherence data is missing for swapped intervals?
Generally speaking, the adherence endpoint relies on the final published schedule state rather than the transient swap request. If the swap was approved but the schedule hasn’t fully republished, the API might still reference the original interval. Check the scheduleVersion in the response header.
Ensure your ServiceNow Data Action is querying the correct version. You can force a refresh by calling POST /api/v2/wfm/schedules/{scheduleId}/publish. The payload transformation often fails if the timezone offset isn’t explicitly handled during the swap processing.
{
"scheduleId": "your_schedule_id",
"reason": "Swap approval sync"
}
Verify the agent’s adherence report in the UI matches the API response. If the UI shows data but the API returns null, it indicates a caching delay in the WFM service. A common fix is to add a 60-second delay in the webhook trigger before the ServiceNow ticket creation.
Note: Always validate the effectiveDate in the schedule version. If the swap date is in the past, the system might archive the adherence data, making it inaccessible via the standard API endpoint.
The documentation actually says adherence data reflects the final published schedule state, so swapping shifts without republishing leaves the API pointing to the original intervals. Verify the scheduleVersion header matches the post-swap version to ensure the data aligns with the approved changes.