Commit 1fd0317a authored by Valery Sizov's avatar Valery Sizov

[Issue multiple assignee] Update webhooks

parent 6ea168bd
...@@ -81,10 +81,14 @@ class Issue < ActiveRecord::Base ...@@ -81,10 +81,14 @@ class Issue < ActiveRecord::Base
end end
def hook_attrs def hook_attrs
assignee_ids = self.assignee_ids
attrs = { attrs = {
total_time_spent: total_time_spent, total_time_spent: total_time_spent,
human_total_time_spent: human_total_time_spent, human_total_time_spent: human_total_time_spent,
human_time_estimate: human_time_estimate human_time_estimate: human_time_estimate,
assignee_ids: assignee_ids,
assignee_id: assignee_ids.first # This key is deprecated
} }
attributes.merge!(attrs) attributes.merge!(attrs)
......
...@@ -99,7 +99,7 @@ Example response: ...@@ -99,7 +99,7 @@ Example response:
] ]
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## List group issues ## List group issues
...@@ -190,7 +190,7 @@ Example response: ...@@ -190,7 +190,7 @@ Example response:
] ]
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## List project issues ## List project issues
...@@ -281,7 +281,7 @@ Example response: ...@@ -281,7 +281,7 @@ Example response:
] ]
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## Single issue ## Single issue
...@@ -357,7 +357,7 @@ Example response: ...@@ -357,7 +357,7 @@ Example response:
} }
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## New issue ## New issue
...@@ -421,7 +421,7 @@ Example response: ...@@ -421,7 +421,7 @@ Example response:
} }
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## Edit issue ## Edit issue
...@@ -486,7 +486,7 @@ Example response: ...@@ -486,7 +486,7 @@ Example response:
} }
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## Delete an issue ## Delete an issue
...@@ -573,7 +573,7 @@ Example response: ...@@ -573,7 +573,7 @@ Example response:
} }
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## Subscribe to an issue ## Subscribe to an issue
...@@ -639,7 +639,7 @@ Example response: ...@@ -639,7 +639,7 @@ Example response:
} }
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## Unsubscribe from an issue ## Unsubscribe from an issue
...@@ -762,7 +762,7 @@ Example response: ...@@ -762,7 +762,7 @@ Example response:
} }
``` ```
**Note**: `assignee` column is deprecated, it shows a first assignee only. **Note**: `assignee` column is deprecated, it shows the first assignee only.
## Set a time estimate for an issue ## Set a time estimate for an issue
......
...@@ -233,6 +233,7 @@ X-Gitlab-Event: Issue Hook ...@@ -233,6 +233,7 @@ X-Gitlab-Event: Issue Hook
"id": 301, "id": 301,
"title": "New API: create/update/delete file", "title": "New API: create/update/delete file",
"assignee_ids": [51], "assignee_ids": [51],
"assignee_id": 51,
"author_id": 51, "author_id": 51,
"project_id": 14, "project_id": 14,
"created_at": "2013-12-03T17:15:43Z", "created_at": "2013-12-03T17:15:43Z",
...@@ -251,6 +252,11 @@ X-Gitlab-Event: Issue Hook ...@@ -251,6 +252,11 @@ X-Gitlab-Event: Issue Hook
"username": "user1", "username": "user1",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon" "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon"
}], }],
"assignee": {
"name": "User1",
"username": "user1",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon"
},
"labels": [{ "labels": [{
"id": 206, "id": 206,
"title": "API", "title": "API",
...@@ -265,6 +271,9 @@ X-Gitlab-Event: Issue Hook ...@@ -265,6 +271,9 @@ X-Gitlab-Event: Issue Hook
}] }]
} }
``` ```
**Note**: `assignee` and `assignee_id` keys are deprecated and now show the first assignee only.
### Comment events ### Comment events
Triggered when a new comment is made on commits, merge requests, issues, and code snippets. Triggered when a new comment is made on commits, merge requests, issues, and code snippets.
...@@ -545,6 +554,7 @@ X-Gitlab-Event: Note Hook ...@@ -545,6 +554,7 @@ X-Gitlab-Event: Note Hook
"id": 92, "id": 92,
"title": "test", "title": "test",
"assignee_ids": [], "assignee_ids": [],
"assignee_id": null,
"author_id": 1, "author_id": 1,
"project_id": 5, "project_id": 5,
"created_at": "2015-04-12 14:53:17 UTC", "created_at": "2015-04-12 14:53:17 UTC",
...@@ -559,6 +569,8 @@ X-Gitlab-Event: Note Hook ...@@ -559,6 +569,8 @@ X-Gitlab-Event: Note Hook
} }
``` ```
**Note**: `assignee_id` field is deprecated and now shows the first assignee only.
#### Comment on code snippet #### Comment on code snippet
**Request header**: **Request header**:
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
} }
}, },
"assignee": { "assignee": {
"type": "object", "type": ["object", "null"],
"properties": { "properties": {
"name": { "type": "string" }, "name": { "type": "string" },
"username": { "type": "string" }, "username": { "type": "string" },
......
...@@ -730,6 +730,11 @@ describe Issue, models: true do ...@@ -730,6 +730,11 @@ describe Issue, models: true do
expect(attrs_hash).to include(:human_total_time_spent) expect(attrs_hash).to include(:human_total_time_spent)
expect(attrs_hash).to include('time_estimate') expect(attrs_hash).to include('time_estimate')
end end
it 'includes assignee_ids and deprecated assignee_id' do
expect(attrs_hash).to include(:assignee_id)
expect(attrs_hash).to include(:assignee_ids)
end
end end
describe '#check_for_spam' do describe '#check_for_spam' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment