summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSujay Patel <sujaypatel1996@gmail.com>2019-06-08 11:54:20 +0530
committersujay <sujay.patel@caavo.com>2019-06-10 15:35:38 +0530
commited8a00b9c41c25af3fcc45892a7d5144d75c6863 (patch)
treebcbb26cea1d92f0c20b6325831b14e4cd60e662f /lib
parent6aa0df5a0f9a71de3e64f8170ebdc1c041a238ff (diff)
downloadgitlab-ce-ed8a00b9c41c25af3fcc45892a7d5144d75c6863.tar.gz
Adding labels to note event payload.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/data_builder/note.rb1
-rw-r--r--lib/gitlab/hook_data/issue_builder.rb3
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/data_builder/note.rb b/lib/gitlab/data_builder/note.rb
index 65601dcdf31..16e62622ed4 100644
--- a/lib/gitlab/data_builder/note.rb
+++ b/lib/gitlab/data_builder/note.rb
@@ -44,6 +44,7 @@ module Gitlab
data[:commit] = build_data_for_commit(project, user, note)
elsif note.for_issue?
data[:issue] = note.noteable.hook_attrs
+ data[:issue][:labels] = note.noteable.labels(&:hook_attrs)
elsif note.for_merge_request?
data[:merge_request] = note.noteable.hook_attrs
elsif note.for_snippet?
diff --git a/lib/gitlab/hook_data/issue_builder.rb b/lib/gitlab/hook_data/issue_builder.rb
index d39ff8c21cc..cfc9ebe4f92 100644
--- a/lib/gitlab/hook_data/issue_builder.rb
+++ b/lib/gitlab/hook_data/issue_builder.rb
@@ -44,7 +44,8 @@ module Gitlab
human_total_time_spent: issue.human_total_time_spent,
human_time_estimate: issue.human_time_estimate,
assignee_ids: issue.assignee_ids,
- assignee_id: issue.assignee_ids.first # This key is deprecated
+ assignee_id: issue.assignee_ids.first, # This key is deprecated
+ labels: issue.labels
}
issue.attributes.with_indifferent_access.slice(*self.class.safe_hook_attributes)