Skip to content

Commit 0b453ca

Browse files
gitlab issue event sends assignees (multiple) not assignee (single) (#161)
I also got hit by the gitlab API change where the IssueEventPayload doesn't contain a field 'assignee' but only 'assignees' - even though there's only one... #159 The 'assignee' field is deprecated but not removed (https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#issue-events) so it's kept in the struct. --------- Co-authored-by: Kuba Raczkowski <[email protected]>
1 parent 200ca6c commit 0b453ca

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

gitlab/payload.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type IssueEventPayload struct {
3838
Repository Repository `json:"repository"`
3939
ObjectAttributes ObjectAttributes `json:"object_attributes"`
4040
Assignee Assignee `json:"assignee"`
41+
Assignees []Assignee `json:"assignees"`
4142
Changes Changes `json:"changes"`
4243
}
4344

testdata/gitlab/issue-event.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,10 @@
7777
"name": "User1",
7878
"username": "user1",
7979
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon"
80-
}
80+
},
81+
"assignees": [{
82+
"name": "User1",
83+
"username": "user1",
84+
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon"
85+
}]
8186
}

0 commit comments

Comments
 (0)