gitlab-org--gitlab-foss/app/services/issues/close_service.rb

28 lines
803 B
Ruby
Raw Normal View History

module Issues
class CloseService < Issues::BaseService
def execute(issue, commit = nil)
2015-12-17 17:08:14 -05:00
if project.jira_tracker? && project.jira_service.active
project.jira_service.execute(commit, issue)
task_service.close_issue(issue, current_user)
2015-12-17 17:08:14 -05:00
return issue
end
if project.default_issues_tracker? && issue.close
event_service.close_issue(issue, current_user)
create_note(issue, commit)
notification_service.close_issue(issue, current_user)
task_service.close_issue(issue, current_user)
execute_hooks(issue, 'close')
end
issue
end
private
def create_note(issue, current_commit)
SystemNoteService.change_status(issue, issue.project, current_user, issue.state, current_commit)
end
end
end