Prevent users from assigning an invalid issue type to new issues
Prior this change, when creating a new issue, the passed parameter `issue_type` wasn't validated for its presence. We only checked if the corresponding policy is allowed. For example: When passing issue_type=incident we check if `create_incident` policy exists. When passing issue_type=foo the policy check failed because there was no `create_foo` policy. When passing issue_type=project, however, passes the policy check for `create_project` but the following assignment of issue_type in Issue fails with 500 error because there is no such issue type (WorkItem::Type soon) "project". This commit checks the presence of the passed issue_type before checking the corresponding policy to prevent such error.
Showing
Please register or sign in to comment