diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/services/issues/close_service.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/services/issues/close_service.rb')
-rw-r--r-- | app/services/issues/close_service.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/app/services/issues/close_service.rb b/app/services/issues/close_service.rb index 746f7d1f4c1..1700d1d8586 100644 --- a/app/services/issues/close_service.rb +++ b/app/services/issues/close_service.rb @@ -24,8 +24,8 @@ module Issues return issue end - if project.issues_enabled? && issue.close - issue.update(closed_by: current_user) + if project.issues_enabled? && issue.close(current_user) + remove_on_close_labels_from(issue) event_service.close_issue(issue, current_user) create_note(issue, closed_via) if system_note @@ -52,6 +52,18 @@ module Issues private + def remove_on_close_labels_from(issue) + old_labels = issue.labels.to_a + + issue.label_links.with_remove_on_close_labels.delete_all + issue.labels.reset + + Issuable::CommonSystemNotesService.new(project: project, current_user: current_user).execute( + issue, + old_labels: old_labels + ) + end + def close_external_issue(issue, closed_via) return unless project.external_issue_tracker&.support_close_issue? |