123 |
123 |
assigned_to = (get_keyword(:assigned_to, :override => true) && find_user_from_keyword(get_keyword(:assigned_to, :override => true)))
|
124 |
124 |
due_date = get_keyword(:due_date, :override => true)
|
125 |
125 |
start_date = get_keyword(:start_date, :override => true)
|
|
126 |
version = (get_keyword(:version, :override => true) && project.versions.find_by_name(get_keyword(:version)))
|
126 |
127 |
|
127 |
128 |
# check permission
|
128 |
129 |
unless @@handler_options[:no_permission_check]
|
129 |
130 |
raise UnauthorizedAction unless user.allowed_to?(:add_issues, project)
|
130 |
131 |
end
|
131 |
132 |
|
132 |
|
issue = Issue.new(:author => user, :project => project, :tracker => tracker, :category => category, :priority => priority, :due_date => due_date, :start_date => start_date, :assigned_to => assigned_to)
|
|
133 |
issue = Issue.new(:author => user, :project => project, :tracker => tracker, :category => category, :priority => priority, :due_date => due_date, :start_date => start_date, :assigned_to => assigned_to, :fixed_version => version)
|
133 |
134 |
# check workflow
|
134 |
135 |
if status && issue.new_statuses_allowed_to(user).include?(status)
|
135 |
136 |
issue.status = status
|
... | ... | |
165 |
166 |
|
166 |
167 |
# Adds a note to an existing issue
|
167 |
168 |
def receive_issue_reply(issue_id)
|
|
169 |
project = target_project
|
168 |
170 |
status = (get_keyword(:status) && IssueStatus.find_by_name(get_keyword(:status)))
|
169 |
171 |
due_date = get_keyword(:due_date, :override => true)
|
170 |
172 |
start_date = get_keyword(:start_date, :override => true)
|
171 |
173 |
assigned_to = (get_keyword(:assigned_to, :override => true) && find_user_from_keyword(get_keyword(:assigned_to, :override => true)))
|
|
174 |
version = (get_keyword(:version, :override => true) && project.versions.find_by_name(get_keyword(:version)))
|
172 |
175 |
|
173 |
176 |
issue = Issue.find_by_id(issue_id)
|
174 |
177 |
return unless issue
|
... | ... | |
188 |
191 |
issue.start_date = start_date if start_date
|
189 |
192 |
issue.due_date = due_date if due_date
|
190 |
193 |
issue.assigned_to = assigned_to if assigned_to
|
|
194 |
issue.fixed_version = version if version
|
191 |
195 |
|
192 |
196 |
issue.save!
|
193 |
197 |
logger.info "MailHandler: issue ##{issue.id} updated by #{user}" if logger && logger.info
|