Hi Walt,
So, glad you saw the two samples I provided which should form the basis for this type of development. I'd say you're correct about compressing the snapshots of your queries only to the Blocked field only so that you can eliminate so much else which may happen with the user stories which isn't related to Blocked/Not-Blocked/Reason and not relevant here, so yes, you're right about that.
You mentioned you didn't know how to get the workspaceID or the projectID:
For the 'Try it out' section in the Lookback API docs you don't really need it cause you can select your workspace from the dropdown. However, in general you probably want to use the WSAPI to retrieve all of your workspace, project and also user stories Object IDs , then use them with the Lookback API calls.
My take on your overall requirement is that you would like to get the cumulative time stories were blocked within a certain time period where each story might have been blocked more than once (meaning blocked, unblocked , then blocked again ... ) during that time.
So you need to first find all stories that were blocked at all during that time period.
Then, for each such story you need to go along my examples, use the Lookback API to find all times they entered block status, each time they got out of block status and compute/add the total time of that story being in blocked status - then you shall add it to the total cumulative blocked time of all stories in that time period.
The most straight forward way to do that is to get the full revision history (compressed for snapshots where Blocked was changed) and then analyzing it, and computing the _ValidFrom and _ValidTo of the instances where the story is blocked. Within that computing you shall offset the timestamps so that your calculation is accurate.
An alternative approach could be similar to the second file I included where you query the Lookback API for specific instances of Blocked changing by querying when it enters its state based on previous state. However, it's a longer approach overall, will require more queries and your code will still need to do the computing, so I don't see how this approach is better, but it's a way to get it done as well.
If you have further more specific questions (perhaps about my provided sample queries) on that then let me know. It also sounded as if you are considering a consultant help. If so, please let me know and I'll have a manager follow up with you on that.
With all that said, I also would like to offer that you post a formal Idea to enhance the product and offer such or similar report as part of the product. Please let me know if you would like to consider that and if you know where/how to post it.
Thanks,
Sagi