How do you get Flow Metrics out of Align using the Align REST API?????/
Asked by lou_rodriguez:

Hello Friends,

This is a challenge for the most tech savvy of you. If you can figure this out, your name will be glorified and will live in infamy within the Atlassian Community. Any help will be greatly appreciated.

**The Challenge**

How do you pull Flow Metrics out of the [Align REST API?](https://help.jiraalign.com/hc/en-us/articles/360045371954-Getting-started-with-the-REST-API-2-0?mobile_site=true) My goal is to pull these metrics from REST Endpoints and run calculation for these flow metrics in a data lake. Can anyone figure out which combination of REST endpoints to use for each flow metric.

**1.Flow Distribution-**Flow distribution counts how many of each flow item (ie. feature, defects, risks, dependencies,) are in a value stream in a given time period like a quarter or Program Increment.

**2.Flow Velocity**- How many flow items (ie. features) were completed in a program increment or quarter.

**3.Flow Time**- Measures the average time from when work is started to completed on a feature in a value stream (ie. program can be a value stream)

**4.Flow Load**- Counts the number of features that are in progress (ie. not done or not in to do status) at the present moment in a value stream5

**5.low Efficiency-** Ratio of active time to waiting time for a feature in a Program Increment

<br />

**6. Flow Predictability**-Ratio of planned vs actual work done in a Program Increment


Answers:
author: Rich Sparks
body: I hate to say this, but the fastest way to get Flow Metrics is to use Enterprise Insights (EI). EI is a reporting database for Jira Align that has all the historical information needed to generate the reports.

My colleague [@Derek Huether](/t5/user/viewprofilepage/user-id/538395) wrote an excellent article explaining this here: here: <https://community.atlassian.com/t5/Jira-Align-articles/How-Jira-Align-Supports-Flow-Metrics/ba-p/1822789>

If you don't want to use EI, you need to extract from Jira Align on a regular basis and build your own reporting datamart (to keep track of all the state transitions and such.) Technically it can be done, but it is faster and more reliable to license Enterprise Insights and build the reports from that datamart.


author: Allan Maxwell
body: Another possibility is to just pull the all the Stories and their State each day. For example:   

{{base_JA_url}}/stories?$select=ID,Title,State\&$filter=releaseId eq 8 \&$top=100

comments: author: Rich Sparks
body: Here [@Allan Maxwell](/t5/user/viewprofilepage/user-id/3502714) provides two examples of what I was suggesting: If you don't use Enterprise Insights, you'd need to build your own process to extract the data on a regular basis then build the data structure to meet your needs.

You could use this example (and the one below) to get the stories and features and epics and track their state on a daily basis. Then you'd need to capture the data for state changes to get your more detailed metrics.

Some items might be easier -- like Item #4 above, counting the number of features in progress at the current state. But then flow efficiency would be more difficult because you have to track the state changes as something may move in and out of "active status."


author: Allan Maxwell
body: Not a great solution, but you could pull the Audit logs for all the work items of interest using {{base_JA_url}}/Stories/26997/AuditLog

![Screen Shot 2021-10-27 at 1.55.08 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/166858i362F7D04B143D81E/image-size/large?v=v2&px=999 "Screen Shot 2021-10-27 at 1.55.08 PM.png")

comments: author: lou_rodriguez
body: Thank you for your input. They all sound like possible solutions but I think Enterprise Insights makes the most sense.  

Were building an app that needs the flow metrics from Jira Align. So our customers will need Enterprise Insights in order to make our app work. I believe with Enterprise Insights we can connect our data lake directly to the EI database and pull data that way.


author: Rich Sparks
body: With Enterprise Insights, you can either:

1. Point your visualization tool directly at EI and run the queries there, or
2. Use interfaces from EI to load the data into your own data lake and combine with other information.


author: lou_rodriguez
body: Thanks [@Rich Sparks](/t5/user/viewprofilepage/user-id/3113667)