diff --git a/changelogs/unreleased/13247-api_project_events_target_iid.yml b/changelogs/unreleased/13247-api_project_events_target_iid.yml new file mode 100644 index 0000000000000000000000000000000000000000..08a31039f77d82ab7a3237a8cd4b067927ffdc7e --- /dev/null +++ b/changelogs/unreleased/13247-api_project_events_target_iid.yml @@ -0,0 +1,4 @@ +--- +title: Expose target_iid in Events API +merge_request: 13247 +author: sue445 diff --git a/doc/api/events.md b/doc/api/events.md index e7829c9f4796f86282a3e7b12534421db35b2c99..6e530317f6c5941930e7c7951a0aa7b86d57c8a5 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -302,6 +302,7 @@ Example response: "project_id":1, "action_name":"opened", "target_id":160, + "target_iid":160, "target_type":"Issue", "author_id":25, "data":null, @@ -322,6 +323,7 @@ Example response: "project_id":1, "action_name":"opened", "target_id":159, + "target_iid":159, "target_type":"Issue", "author_id":21, "data":null, diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 5cdc441e8cbd9664f242651084db300ea2570368..0a71c976c7eb8081f06457ca4ebd99edd6571dab 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -483,7 +483,7 @@ module API class Event < Grape::Entity expose :title, :project_id, :action_name - expose :target_id, :target_type, :author_id + expose :target_id, :target_iid, :target_type, :author_id expose :data, :target_title expose :created_at expose :note, using: Entities::Note, if: ->(event, options) { event.note? }