Defect #44560
openIssue creation fails when the default assignee is no longer assignable
Description
When the default assignee of a project or an issue category is no longer assignable, creating an issue fails with the error "Assignee is invalid", even if the user did not choose an assignee.
The problem can be reproduced as follows:
1. Set a user as the default assignee of a project.
2. Lock the user, or turn off "Issues can be assigned to this role" for the user's role.
3. Create a new issue in the project without choosing an assignee.
The issue is not created. Note that Redmine already clears a default assignee who is removed from the project, but not one who is locked or whose role no longer allows issue assignment.
The user who creates the issue often cannot correct the setting, because it requires permission to manage the project or its categories. Issues created by incoming emails, CSV imports or the REST API fail in the same way, and the sender of an incoming email gets no clear explanation.
The attached patch changes Issue#default_assign to skip a default assignee who is no longer assignable. If the category's default assignee is skipped, the project's default assignee is used instead. If neither is assignable, the issue is created without an assignee. Redmine already works in a similar way when an issue is copied to another project: an assignee who is not assignable there is cleared. The patch includes tests for both the category and the project default assignee.
Files
No data to display