45e1941fb3
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)
20 lines
513 B
Ruby
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
|