dmorfav opened a new issue, #9369:
URL: https://github.com/apache/devlake/issues/9369

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/devlake/issues?q=is%3Aissue) and found no 
similar issues.
   
   ### What happened
   
   In the **Jira** Grafana dashboard (`grafana/dashboards/mysql/Jira.json`), 
the panel **"Sprint Velocity: Committed vs Completed Story Points [Closed 
Sprints]"** is unreadable on long-lived boards:
   
   1. It shows sprints that belong to **other boards**. The query joins 
`sprints` with `board_sprints` only by `board_id`, and the Jira Agile API 
returns, for a board, every sprint any of its issues has ever been in. Issues 
that were moved between teams bring those teams' sprints along.
   2. It **ignores the dashboard time range**: there is no `$__timeFilter`, so 
every historical sprint is plotted regardless of the selected range.
   
   On a board with a few years of history this renders hundreds of bars with 
overlapping labels, mixing sprints from several unrelated boards.
   
   ### What do you expect to happen
   
   The panel should only show closed sprints owned by the selected board(s) and 
completed within the selected time range.
   
   ### How to reproduce
   
   1. Collect a Jira board whose issues have previously been in sprints of 
other boards (e.g. issues moved between teams).
   2. Open the **Jira** dashboard, select that board and a range such as "Last 
6 months".
   3. The Sprint Velocity panel lists sprints from other boards and from years 
before the selected range.
   
   ### Anything else
   
   Proposed fix, adding two conditions to the panel query:
   
   ```sql
   SELECT
     s.name AS sprint,
     s.committed_story_point AS 'Committed',
     s.completed_story_point AS 'Completed'
   FROM sprints s
     JOIN board_sprints bs ON bs.sprint_id = s.id
   WHERE
     bs.board_id in (${board_id})
     AND s.original_board_id = bs.board_id
     AND s.committed_story_point is not null
     AND $__timeFilter(s.completed_date)
   ORDER BY s.completed_date asc
   ```
   
   Tested on v1.0.3-beta19: with the fix the panel shows only the board's own 
closed sprints in the selected range. The current query on `main` is unchanged, 
so the issue still applies.
   
   ### Version
   
   v1.0.3-beta19
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to