Project

General

Profile

Actions

Feature #18212

closed

The status of parent issue could be changed to closed before all of the sub issues' status are changed to closed

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

Added by Haiyang He about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Resolution:
Duplicate

Description

I have fixed this issue on my local redmine.

Add the following code after the 73 line of app/models/issue.rb

validate :closed_before_sub_issues

Add the closed_before_sub_issues method:

def closed_before_sub_issues
    closedIssueStatus = IssueStatus.find_by_is_closed true
    if closedIssueStatus && status_id == closedIssueStatus.id
      if descendants.any? { |childIssue| childIssue.status_id != closedIssueStatus.id}
        errors.add :status_id, :cant_close_before_sub_issues_closed
      end
    end
  end

Add error message in the en.yml:
cant_close_before_sub_issues_closed: can change the status to closed before the all the sub issue are not closed


Related issues 1 (0 open — 1 closed)

Is duplicate of Redmine - Feature #10989: Prevent parent issue from being closed if a child issue is openClosedJean-Philippe LangActions

Updated by Toshi MARUYAMA about 12 years ago Actions #1

  • Description updated (diff)
  • Category set to Issues

Updated by Toshi MARUYAMA about 12 years ago Actions #2

  • Tracker changed from Defect to Feature
  • Status changed from New to Closed
  • Resolution set to Duplicate

Duplicate of #10989.

Updated by Toshi MARUYAMA about 12 years ago Actions #3

  • Is duplicate of Feature #10989: Prevent parent issue from being closed if a child issue is open added
Actions

Also available in: PDF Atom