Uploaded image for project: 'Jira Software Server and Data Center'
  1. Jira Software Server and Data Center
  2. JSWSERVER-13783

Velocity report should only show sprints related to the current board

    XMLWordPrintable

    Details

    • Introduced in Version:
      7.01
    • Support reference count:
      110
    • Symptom Severity:
      Severity 3 - Minor
    • UIS:
      127
    • Current Status:
      Hide
      Atlassian Update – 22 Oct 2018

      Hi everyone,

      We have recently reviewed this issue and the overall interest in the problem.
      We acknowledge that the issue has a high impact on the software teams and agree that it has to be prioritised in the Short Term which corresponds the current status of the bug.

      We would aim to address the issue within the next 3 months or so, yet please do not consider this a deadline to fix the bug, but rather as an estimated timeline.
      Please refer to Atlassian Bugfix Policy for the details on how we prioritise and deliver fixes in our product.

      Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments.

      Thank you,
      Ignat Alexeyenko
      Jira Bugmaster

      Show
      Atlassian Update – 22 Oct 2018 Hi everyone, We have recently reviewed this issue and the overall interest in the problem. We acknowledge that the issue has a high impact on the software teams and agree that it has to be prioritised in the Short Term  which corresponds the current status of the bug. We would aim to address the issue within the next 3 months or so, yet please do not consider this a deadline to fix the bug, but rather as an estimated timeline. Please refer to Atlassian Bugfix Policy for the details on how we prioritise and deliver fixes in our product. Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments. Thank you, Ignat Alexeyenko Jira Bugmaster

      Description

      Original description

      Currently, if any issues in Sprint A in one board (Board A) got moved to Sprint B in another board (Board B), Sprint B will show up in the Velocity Report of Board A.

      It would be nice to limit sprints within a board in the Velocity Report, so no other sprints belonging to other boards should show up in the report.

      Summary

      Velocity Report includes Sprints from other Boards.

      Environment

      • 2016-01-18 Cloud, 2016-02-01 Cloud, 1000.383.2 Cloud
      • JIRA 7.x Server

      Steps to Reproduce

      Scenario 1

      • You have Board A with filter "project = A". You have Sprint A with issue A-1, A-2 inside it. Sprint A has to be a future Sprint otherwise it correctly shows up in the report.
      • You have Board B with filter "project = B". You have Sprint B with issue B-1, B-2 inside it. Sprint B has to be a future Sprint otherwise it correctly shows up in the report.

      If issue A-1 is moved to Sprint B, it means that Sprint B will contain 1 issue that matches the filter of Board A, thus Sprint B will APPEAR in Board A. If that happens then the Velocity Report of Board A will include Sprint B too.

      Scenario 2

      • You have Board A with filter "project = A". You have Sprint A with issue A-1, A-2 inside it. Sprint A is a completed Sprint.
      • You have Board B with filter "project = B".

      There are also other scenarios that don't rely on the issue being moved from project to project, as long as the following conditions are met the bug will surface:

      1. The issue contains another sprint in the customfieldvalue
      2. the issue contains another sprint in the history of the issue (i.e. it has an entry in changeitem).

      Scenario 3

      You have multiple boards that have filters wide enough to pull in issues for multiple boards, the issues do not need to have been moved from project to project

      Scenario 4

      At one point one the issue was part of another sprint in another board and the sprint was started. The issue is then moved from an open or closed sprint to a new sprint, this will cause the same behavior in the Velocity report regardless of whether or not the issue was moved from project to project.

      Expected Results

      • Velocity Report should only show sprints from other boards if the issues were moved between active sprints, not in planning phase (between future sprints).
        • As moving issues to-from sprints affects velocity (committed/completed), the report should show it accordingly.
      • Velocity Report should not include completed sprints from other boards, as they were not committed/completed in the current board.

      Actual Results

      Velocity Report includes sprints outside the scope of the board, and sprints might result empty:

      Notes

      For Scenario 2, board admin may:

      1. Reopen Sprint A from Board B's Sprint Report
      2. Remove issue B-1 (formerly A-1) from Sprint A
      3. Complete Sprint A

      In this case, Sprint A doesn't contain anything related to Board B at all, but:

      1. It's still included in Board B's Velocity Report (as an empty sprint)
      2. It disappears from Board B's Sprint Report

      Workaround: 

      This is something I've come up with for customer who had this issue, it require direct DB manipulation so PLEASE make sure to backup your DB and test this in dev or stage before moving these changes to a production instance...

      Here's our affected velocity report: 

      Step one grab the offending issues: 

      So we take the offending sprint that is showing up in the velocity report and search to see if there are any issues that are in the current project but shouldn't be listed as part of that sprint. 

      JQL: Sprint = sprint 

      This will return a list of issues, in my case it's TAG-24 that I transferred from the sourceproject:

      This is pretty blatant in my example, but if you want to safe, compare these results to your board filter to be safe before moving forward, now on to the mitigation. 

      Step Two remove historical reference of old sprint from affected issues: 

      Now that we know which sprint is causing this let's look at the history in the DB: 

      SELECT p.pname, p.pkey, i.issuenum, cg.ID, cg.issueid, au.lower_user_name, cg.AUTHOR, cg.CREATED, ci.FIELDTYPE, ci.FIELD, ci.OLDVALUE, ci.OLDSTRING, ci.NEWVALUE, ci.NEWSTRING
      FROM changegroup cg
      inner join jiraissue i on cg.issueid = i.id
      inner join project p on i.project = p.id
      inner join changeitem ci on ci.groupid = cg.id
      inner join app_user au on cg.author = au.user_key
      WHERE cg.issueid=(select id from jiraissue where issuenum = 24 and project in (select id from project where pname = 'tagetproject')) 
      order by 1,3,4;

      This will return something like this:

      We know that sprint 17 the sprint that is showing up erroneously, so let's kill the value from changitem, this is the first item listed so we'll kill that item:

      delete from changeitem where groupid=10294;
      delete from changegroup where id=10294;

      Step Three remove the sprint custom field value:

      We now need to delete the old sprint from the custom value for this issue, you can grab the issue id from last query, in my case it's 10182.
      We also need the sprint's custom field ID, we can get that from the GUI by navigating to custom fields and editing the sprint field:

      Now that we have that we can determine what value to delete:

       select * from customfieldvalue where issue=10182;

      I know I need to remove sprint 17 from this issue and I know my custom field id is 10104, so I'll remove that entry.

       delete from customfieldvalue where id=10307;

      Step 4 Reindex the Project:
      At this point we reindex the issue's project, and voila, no old sprint info in the report:

        Attachments

        1. Capture.GIF
          Capture.GIF
          45 kB
        2. queryresults.png
          queryresults.png
          138 kB
        3. searchresults.png
          searchresults.png
          575 kB
        4. sprintid.png
          sprintid.png
          444 kB
        5. sprintremove.png
          sprintremove.png
          39 kB
        6. Tim Hagen's broken velocity chart.png
          Tim Hagen's broken velocity chart.png
          80 kB
        7. updated report.png
          updated report.png
          205 kB
        8. velocity.png
          velocity.png
          72 kB
        9. velocityreport.png
          velocityreport.png
          168 kB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              ddiblasio David Di Blasio
              Votes:
              299 Vote for this issue
              Watchers:
              240 Start watching this issue

                Dates

                Created:
                Updated: