- Create a sprint containing some issues and start it.
- Add two more issues to the sprint after you've started it:
- An issue in a 'done' status (e.g. Closed).
- An issue in a 'not-done' status (e.g. In Progress).
- Use addedAfterSprintStart in the issue navigator to search for issues in the sprint.
- Result is as expected: both of the subsequently-added issues are returned, and no others.
- Complete the sprint.
- Repeat the search.
- Expected result: the same issues are returned as before.
- Actual result: only the non-done issue is returned.
The problem arises because we call RapidViewClauseService#getClauseForBuilder(...) with the PLAN_MODE_ISSUES clause type. This produces a clause that only matches issues which a user would expect to see while planning: namely, all uncompleted issues plus any issues - completed or otherwise - that are part of ongoing sprints. What we need instead is a clause which matches all issues irrespective of status.