As long as we can identify one work item, we can get that item's history from Lookback API and discover the deleted user's OID. Then we can use a second LBAPI query to get all items previously owned by the deleted user regardless of current owner.
Lookback API returns historic data, but a query by username does not work. Lookback API can only retrieve snapshots when owner is filtered by ObjectID. We do not have ObjectID of the deleted user.
Find at least one work item that was owned by the deleted user, where the owner has not been reset. In AgileCentral a work item owned by a deleted user shows the deleted user's name as long as the Owner field has not been set to a different user.
We find one work item where this user's Display Name is still shown.
When we access the details page of the story the Owner field is empty, even though the summary page shows the grayed out Display Name of the deleted user in the Owner column.
This grayed out Display Name provides enough information to find all work items owned by this user using two queries:
Query #1:
get historic data for the story. In the query below we use ObjectID of the story, and make sure to include "Owner" field in the fields clause:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/<WORKSPACE_OID>/artifact/snapshot/query.js?find={"ObjectID":<OBJECT_ID>}&fields=["FormattedID","_ValidTo","_ValidFrom","Owner"]&removeUnauthorizedSnapshots=true
Here is a screenshot of the result. There are 6 snapshots, and one of them shows the deleted owner's ObjectID:
To understand why it works remember that past is unchangeable. At one point in the past this story had the owner, and the corresponding snapshot was created. The fact that the owner was deleted later does not alter the pre-existing snapshot.
Query #2:
Now that we have the ObjectID of the deleted user we can query on all workitems that this user used to own:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/<WORKSPACE_OID>/artifact/snapshot/query.js?find={"Owner":<OWNER_OID>}&fields=["FormattedID","ObjectID","_ValidTo","_ValidFrom","Owner"]&removeUnauthorizedSnapshots=true
Here is a screenshot of the result. There are two more work items previously owned by this user: DE672 and DE673. Note that even if these defects have a new owner, the results of this query will not be changed.