Value stream (VSM) analytics in group custom workflow board
### Relevant epics
- https://gitlab.com/groups/gitlab-org/-/epics/364
- https://gitlab.com/groups/gitlab-org/-/epics/424
- https://gitlab.com/groups/gitlab-org/-/epics/505
- https://gitlab.com/groups/gitlab-org/-/epics/433
- https://gitlab.com/groups/gitlab-org/-/epics/229
### Design
- Applies only to group boards created with https://gitlab.com/groups/gitlab-org/-/epics/424.
- View metrics in area chart over time.
- Analytics in group board, where you already have a scoping defined.
- Statistics are averages.
- Metrics are stage times and also combined/summed stage times, which are total cycle time.
- This chart and data would be in the board itself.
<img src="/uploads/7f8d1fbf924b6371b5aee0c280f4f09e/cycle-time.png" height="500px" />
### Algorithm
- Suppose there are workflow states configured as: `Ready`, `Development`, `Review`, `UAT`.
- The metrics will _not_ capture time in the first workflow state, this example being `Ready`, because we are not considering the time it takes from creating an issue (opening it), to it being started to work on. There is a lot of reasons why an issue could be part of scope of a milestone. So in this feature, we don't capture those.
- The board already has a board config, so it will consider issues scoped to that board config.
- The metrics are in time, in calendar months, in particular. So there will be a data set for each calendar month.
- Given the current calendar month, look at all issues (in board config scope), that have the latest `closed_at` timestamp within that month. That is, we only care about issues that have completed the entire value stream by being closed.
- For a given issue, look at how much time it has spent in `Development`, in `Review`, and in `UAT`. To know how much time. This time might actually have been spent before (outside) that calendar month. Doesn't matter. For ease of calculation, we are just using when the issue was finally last closed, to consider it part of the calculation.
- There are at least two ways to figure out how much time an in scope issue has spent in each stage after the first stage. You can use time stamps, or you can add chunks (keep track) of time each time and issue changes workflow state.
- Average overall all issues in each stage in each month.
epic