diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 17:16:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 17:16:28 +0300 |
commit | e4384360a16dd9a19d4d2d25d0ef1f2b862ed2a6 (patch) | |
tree | 2fcdfa7dcdb9db8f5208b2562f4b4e803d671243 /app/services/issues/base_service.rb | |
parent | ffda4e7bcac36987f936b4ba515995a6698698f0 (diff) |
Add latest changes from gitlab-org/gitlab@16-2-stable-eev16.2.0-rc42
Diffstat (limited to 'app/services/issues/base_service.rb')
-rw-r--r-- | app/services/issues/base_service.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/services/issues/base_service.rb b/app/services/issues/base_service.rb index f982d66eb08..b9b7cd08b68 100644 --- a/app/services/issues/base_service.rb +++ b/app/services/issues/base_service.rb @@ -111,6 +111,10 @@ module Issues issue.namespace.execute_integrations(issue_data, hooks_scope) execute_incident_hooks(issue, issue_data) if issue.work_item_type&.incident? + + return unless Feature.enabled?(:group_mentions, issue.project) + + execute_group_mention_hooks(issue, issue_data) if action == 'open' end # We can remove this code after proposal in @@ -121,6 +125,21 @@ module Issues issue.namespace.execute_integrations(issue_data, :incident_hooks) end + def execute_group_mention_hooks(issue, issue_data) + return unless issue.instance_of?(Issue) + + args = { + mentionable_type: 'Issue', + mentionable_id: issue.id, + hook_data: issue_data, + is_confidential: issue.confidential? + } + + issue.run_after_commit_or_now do + Integrations::GroupMentionWorker.perform_async(args) + end + end + def update_project_counter_caches?(issue) super || issue.confidential_changed? end |