gitlab-org--gitlab-foss/app/services/issues/close_service.rb
Jeroen van Baarsen 45e1941fb3 Return a little more information in Issue webhook
When a webhook for issues is triggered, it should also return the
resource URL, and the action that was performed (ie: Was it reopened,
updated, opened or closed)
2014-06-13 12:14:43 +02:00

20 lines
513 B
Ruby

module Issues
class CloseService < Issues::BaseService
def execute(issue, commit = nil)
if issue.close
notification_service.close_issue(issue, current_user)
event_service.close_issue(issue, current_user)
create_note(issue, commit)
execute_hooks(issue, 'close')
end
issue
end
private
def create_note(issue, current_commit)
Note.create_status_change_note(issue, issue.project, current_user, issue.state, current_commit)
end
end
end