Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit e0d08fe

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent 905164e commit e0d08fe

File tree

4 files changed

+160
-0
lines changed

4 files changed

+160
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: API changes for Multiple Issue Assignees
3+
author_name: nakajima
4+
---
5+
GitHub recently added the ability to assign up to ten people to issues. We're updating Issue payloads and adding a couple new endpoints to help you build apps. You can enable these changes during the preview period by providing a custom [media type][media-type] in the `Accept` header:
6+
7+
application/vnd.github.cerberus-preview
8+
9+
For example:
10+
11+
``` command-line
12+
curl "https://api.github.com/repos/github/hubot/issues" \
13+
-H 'Authorization: token TOKEN' \
14+
-H "Accept: application/vnd.github.cerberus-preview" \
15+
```
16+
17+
The issues returned in this list will include the new `assignees` key.
18+
19+
You can learn more about the new responses and endpoints in the updated [Issues][issues] and [Issue Assignees][issue-assignees] documentation
20+
21+
[media-type]: /v3/media
22+
[issues]: /v3/issues
23+
[issue-assignees]: /v3/issues/assignees

content/v3/issues.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,23 @@ Name | Type | Description
162162
`assignee`|`string` | Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise._
163163
`milestone`|`integer` | The `number` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._
164164
`labels`|`array` of `strings` | Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._
165+
`assignees`|`array` of `strings` | Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._
166+
167+
{{#tip}}
168+
169+
<a name="preview-period"></a>
170+
171+
The `assignees` parameter is currently available for developers to preview.
172+
During the preview period, the API may change without advance notice.
173+
Please see the [blog post](/changes/2016-5-27-multiple-assignees) for full details.
174+
175+
To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
176+
177+
application/vnd.github.cerberus-preview+json
178+
179+
The `assignees` key will only be accepted in issue payloads if this header is passed.
180+
181+
{{/tip}}
165182

166183
#### Example
167184

@@ -178,6 +195,25 @@ Name | Type | Description
178195
<%= headers 201, :Location => get_resource(:full_issue)['url'] %>
179196
<%= json :full_issue %>
180197

198+
{% if page.version == 'dotcom' %}
199+
#### Multiple Assignees
200+
201+
{{#tip}}
202+
203+
<a name="preview-period"></a>
204+
205+
An additional `assignees` object in the issue payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice.
206+
Please see the [blog post](/changes/2016-5-27-multiple-assignees) for full details.
207+
208+
To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
209+
210+
application/vnd.github.cerberus-preview
211+
212+
The `assignees` key will be an Array of Users who are assigned to the issue.
213+
214+
{{/tip}}
215+
{% endif %}
216+
181217
## Edit an issue
182218

183219
Issue owners and users with push access can edit an issue.
@@ -194,7 +230,23 @@ Name | Type | Description
194230
`state`|`string` | State of the issue. Either `open` or `closed`.
195231
`milestone`|`integer` | The `number` of the milestone to associate this issue with or `null` to remove current. _NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise._
196232
`labels`|`array` of `strings` | Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (`[]`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._
233+
`assignees`|`array` of `strings` | Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. .Send an empty array (`[]`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._
197234

235+
{{#tip}}
236+
237+
<a name="preview-period"></a>
238+
239+
The `assignees` parameter is currently available for developers to preview.
240+
During the preview period, the API may change without advance notice.
241+
Please see the [blog post](/changes/2016-5-27-multiple-assignees) for full details.
242+
243+
To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
244+
245+
application/vnd.github.cerberus-preview+json
246+
247+
The `assignees` key will only be present in issue payloads if this header is passed.
248+
249+
{{/tip}}
198250

199251
#### Example
200252

@@ -212,6 +264,25 @@ Name | Type | Description
212264
<%= headers 200 %>
213265
<%= json :full_issue %>
214266

267+
{% if page.version == 'dotcom' %}
268+
#### Multiple Assignees
269+
270+
{{#tip}}
271+
272+
<a name="preview-period"></a>
273+
274+
An additional `assignees` object in the issue payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice.
275+
Please see the [blog post](/changes/2016-5-27-multiple-assignees) for full details.
276+
277+
To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
278+
279+
application/vnd.github.cerberus-preview
280+
281+
The `assignees` key will be an Array of Users who are assigned to the issue.
282+
283+
{{/tip}}
284+
{% endif %}
285+
215286
{% if page.version == 'dotcom' %}
216287

217288
## Lock an issue

content/v3/issues/assignees.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,62 @@ Otherwise a `404` status code is returned.
3535
<%= headers 404 %>
3636

3737
[available assignees]: https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/
38+
39+
## Add assignees to an Issue
40+
41+
{{#tip}}
42+
43+
<a name="preview-period"></a>
44+
45+
This endpoint is currently available for developers to preview.
46+
During the preview period, the API may change without advance notice.
47+
Please see the [blog post](/changes/2016-5-27-multiple-assignees) for full details.
48+
49+
To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
50+
51+
application/vnd.github.cerberus-preview+json
52+
53+
{{/tip}}
54+
55+
56+
This call adds the users passed in the `assignees` key (as their logins) to the issue.
57+
58+
POST /repos/:owner/:repo/issues/:number/assignees
59+
60+
### Input
61+
62+
<%= json({"assignees" => %w(hubot other_assignee)}) %>
63+
64+
### Response
65+
66+
<%= headers 201 %>
67+
<%= json(:issue_with_assignees) { |h| [h] } %>
68+
69+
## Remove assignees from an Issue
70+
71+
{{#tip}}
72+
73+
<a name="preview-period"></a>
74+
75+
This endpoint is currently available for developers to preview.
76+
During the preview period, the API may change without advance notice.
77+
Please see the [blog post](/changes/2016-5-27-multiple-assignees) for full details.
78+
79+
To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
80+
81+
application/vnd.github.cerberus-preview+json
82+
83+
{{/tip}}
84+
85+
This call removes the users passed in the `assignees` key (as their logins) from the issue.
86+
87+
DELETE /repos/:owner/:repo/issues/:number/assignees
88+
89+
### Input
90+
91+
<%= json({"assignees" => %w(hubot other_assignee)}) %>
92+
93+
### Response
94+
95+
<%= headers 200 %>
96+
<%= json(:issue_with_assignees) { |h| [h] } %>

lib/responses/issues_and_prs.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ module Responses
133133
"closed_by" => USER
134134
})
135135

136+
ISSUE_WITH_ASSIGNEES ||= ISSUE.merge({
137+
"assignees" => [
138+
USER.merge("login" => "hubot"),
139+
USER.merge("login" => "other_user")
140+
]
141+
})
142+
136143
ISSUE_COMMENT ||= {
137144
"id" => 1,
138145
"url" => "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",

0 commit comments

Comments
 (0)