Feature #10989

Prevent parent issue from being closed if a child issue is open

Added by ravi jain almost 5 years ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues
Target version:3.4.0
Resolution:Fixed

Description

I am able to close a parent issue while its Child issues are yet not closed/rejected, ideally it should not let a use to close a Parent issue, until all it's child issues are not closed.

cant_close_before_sub_issues_closed.patch Magnifier (2.79 KB) Marius BALTEANU, 2016-09-20 10:15

cant_close_before_sub_issues_closed_v2.patch Magnifier (2.81 KB) Marius BALTEANU, 2016-10-20 14:53

cant_close_before_sub_issues_closed_v3.patch Magnifier (2.81 KB) Marius BALTEANU, 2016-12-16 10:13


Related issues

Related to Redmine - Feature #13585: Make sub-task inherit the properties of parent New
Duplicated by Redmine - Feature #12956: Warning "parent issue is closed" Closed
Duplicated by Redmine - Feature #18212: The status of parent issue could be changed to closed bef... Closed
Duplicated by Redmine - Feature #5462: Blocking issues to be closed which have open subtasks Closed 2010-05-07

Associated revisions

Revision 16108
Added by Jean-Philippe Lang 3 months ago

Prevent parent issue from being closed if a child issue is open (#10989).

History

#1 Updated by Jean-Philippe Lang almost 5 years ago

  • Tracker changed from Defect to Feature
  • Subject changed from Parent issue can be closed, while it's child issues are still open to Prevent parent issue from being closed, while it's child issues are still open
  • Assignee deleted (Azamat Hackimov)
  • Priority changed from High to Normal

#2 Updated by Toshi MARUYAMA over 2 years ago

  • Duplicated by Feature #12956: Warning "parent issue is closed" added

#3 Updated by Toshi MARUYAMA over 2 years ago

  • Duplicated by Feature #18212: The status of parent issue could be changed to closed before all of the sub issues' status are changed to closed added

#4 Updated by Ami Desai almost 2 years ago

+1

#5 Updated by Go MAEDA 7 months ago

I think the behavior is logical and this feature is really needed.

#18212 has a patch.

#6 Updated by Marius BALTEANU 7 months ago

This means also that we shouldn't be able to add to a new/open issue a parent which is already closed?

#7 Updated by Marius BALTEANU 6 months ago

I made a patch (inspired from #18212) with tests that implements this feature request.

@Go MAEDA, I still think that in order to implement this completely, we should not allow to set for a new/open issue a parent which is already closed. I'm waiting for your feedback (or other Redmine contributors) in order to include also this change in the patch.

#8 Updated by Toshi MARUYAMA 6 months ago

  • Related to Feature #13585: Make sub-task inherit the properties of parent added

#9 Updated by Toshi MARUYAMA 6 months ago

  • Related to deleted (Feature #13585: Make sub-task inherit the properties of parent)

#10 Updated by Toshi MARUYAMA 6 months ago

  • Related to Feature #13585: Make sub-task inherit the properties of parent added

#11 Updated by Toshi MARUYAMA 6 months ago

  • Duplicated by Feature #5462: Blocking issues to be closed which have open subtasks added

#12 Updated by Toshi MARUYAMA 6 months ago

Marius BALTEANU wrote:

I made a patch (inspired from #18212) with tests that implements this feature request.

LGTM.

I have some questions.

What happens if opened child issues which user cannot see (private/visibility)?

 error_can_not_close_issue_with_open_subtasks: "An issue with open subtasks cannot be closed" 

Would it better "An issue" -> "The issue"?

@Go MAEDA, I still think that in order to implement this completely, we should not allow to set for a new/open issue a parent which is already closed. I'm waiting for your feedback (or other Redmine contributors) in order to include also this change in the patch.

I think this would better in separate issue.

#13 Updated by Marius BALTEANU 6 months ago

Toshi MARUYAMA wrote:

What happens if opened child issues which user cannot see (private/visibility)?

The user will receive the same error message and I think that is the correct behavior because any open subtask means work to do (from my point of view).
If you have the following scenario:
  • Issue with 4 subtasks
  • Two are visible to my role
  • Other two are visible to another role.

Closing my subtasks doesn't means that the parent issue can be closed, it means only that I made my piece of work. If you think that it'll be confusing for the users, we can improve the error message.

Would it better "An issue" -> "The issue"?

I took some internal feedback and the new proposal is "You cannot close an issue with open subtasks.". Let me know what do you think in order to update the patch.

@Go MAEDA, I still think that in order to implement this completely, we should not allow to set for a new/open issue a parent which is already closed. I'm waiting for your feedback (or other Redmine contributors) in order to include also this change in the patch.

I think this would better in separate issue.

Agree, I'll open a new issue.

#14 Updated by Toshi MARUYAMA 5 months ago

  • Target version set to Candidate for next major release

#15 Updated by Toshi MARUYAMA 5 months ago

Marius BALTEANU wrote:

Let me know what do you think in order to update the patch.

Please update the patch.

#17 Updated by Toshi MARUYAMA 4 months ago

  • Target version changed from Candidate for next major release to 3.4.0

#18 Updated by Marius BALTEANU 3 months ago

Fixed the expected error message in the test.

#19 Updated by Jean-Philippe Lang 3 months ago

  • Subject changed from Prevent parent issue from being closed, while it's child issues are still open to Prevent parent issue from being closed if a child issue is open
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Added in r16108. It prevents a parent task with open subtasks from being closed and a subtask of a closed issue from being reopened (in the same way as blocked issues were currently handled). It also prevents an open issue to be set as a subtask of a closed parent issue.

#20 Updated by Jean-Philippe Lang 3 months ago

I took some internal feedback and the new proposal is "You cannot close an issue with open subtasks."

I chose to use "An open issue cannot be attached to a closed parent task" to be consistent with other validation messages (eg. "An issue cannot be linked to one of its subtasks").

#21 Updated by Marius BALTEANU 3 months ago

Thanks for implementing this. The new error message is fine for me.

Also available in: Atom PDF