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
end
def hook_attrs
assignee_ids = self.assignee_ids
attrs = {
total_time_spent: 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)
......
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......
......@@ -233,6 +233,7 @@ X-Gitlab-Event: Issue Hook
"id": 301,
"title": "New API: create/update/delete file",
"assignee_ids": [51],
"assignee_id": 51,
"author_id": 51,
"project_id": 14,
"created_at": "2013-12-03T17:15:43Z",
......@@ -251,6 +252,11 @@ X-Gitlab-Event: Issue Hook
"username": "user1",
"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": [{
"id": 206,
"title": "API",
......@@ -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
Triggered when a new comment is made on commits, merge requests, issues, and code snippets.
......@@ -545,6 +554,7 @@ X-Gitlab-Event: Note Hook
"id": 92,
"title": "test",
"assignee_ids": [],
"assignee_id": null,
"author_id": 1,
"project_id": 5,
"created_at": "2015-04-12 14:53:17 UTC",
......@@ -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
**Request header**:
......
......@@ -49,7 +49,7 @@
}
},
"assignee": {
"type": "object",
"type": ["object", "null"],
"properties": {
"name": { "type": "string" },
"username": { "type": "string" },
......
......@@ -730,6 +730,11 @@ describe Issue, models: true do
expect(attrs_hash).to include(:human_total_time_spent)
expect(attrs_hash).to include('time_estimate')
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
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