Forge app/gadget with release progress

I’m using forge for Jira Cloud. I’d like to display release progress in a graph so I need to get data on how many release issues are done, in progress and left to do. Querying for issues in the release and looping through them to get the data takes too long for multiple releases. How can I quickly get this data? I tried the REST endpoint /rest/api/3/version/${fixVersion}/relatedIssueCounts which example showed has the data I need but what I get is not saticfactory:
{"self":"https://api.atlassian.com/ex/jira/967ca973-8dff-40c5-a2b8-ec2dad1ddbdd/rest/api/3/version/11505","issuesFixedCount":87,"issuesAffectedCount":0,"issueCountWithCustomFieldsShowingVersion":0}

What is the best way to get this data for the graph?

Welcome to the Atlassian Developer Community, @EdShober!

To get the count of issues under the toDo, inProgress, and done states, given that you already have the version ID, you can use the Get version REST API and expand issuesstatus. The endpoint will be /rest/api/2/version/{versionId}?expand=issuesstatus and the result will look like this:

{
  "self": "https://mysite.atlassian.net/rest/api/2/version/10001",
  "id": "10001",
  "name": "1.1",
  "archived": false,
  "released": false,
  "projectId": 10000,
  "issuesStatusForFixVersion": {
    "unmapped": 0,
    "toDo": 0,
    "inProgress": 1,
    "done": 1
  }
}

Hope this helps.

Ian

Thanks ianRagudo! That worked great! I had overlooked that option in the documentation.