Issue Summary
When a scheduled rule returns multiple work items and there's an action to retrieve worker details, the action can fail due to the expired token from the Workday API client.
Steps to Reproduce
- Create a scheduled rule with a JQL that returns multiple work items.
- Add a retrieve worker details action.
- Set the rule to run every 1 hour.
Expected Results
The rule should run correctly without errors.
Actual Results
The rule will eventually fail with the error below:
We couldn't retrieve the details for worker ID: . Check your Workday connection settings and try again. <workday-id>
Workaround
To ensure the token is refreshed, you can use the approach below:
- Remove the JQL query in the schedule trigger by unticking “Run a JQL search and execute actions for each work item in the query”.
- Add retrieve worker details from Workday action as the first action and put in any valid Workday ID. This can be any random valid worker ID. Here is the action that will refresh the token.
- Add “for each” branch and select “Branch rule / related work items”, then select JQL as “Type of related work items”.
- In the JQL field within the branch, put in the previous JQL query from the trigger.
- In this branch, add action Retrieve worker details from Workday.