Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0e09fdc9
Commit
0e09fdc9
authored
Apr 05, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Multiple issue assignees] fix v4 API for issues
parent
4a35d4b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
16 deletions
+19
-16
app/controllers/concerns/issuable_collections.rb
app/controllers/concerns/issuable_collections.rb
+1
-1
lib/api/issues.rb
lib/api/issues.rb
+2
-2
spec/fixtures/api/schemas/public_api/v4/issues.json
spec/fixtures/api/schemas/public_api/v4/issues.json
+15
-12
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+1
-1
No files found.
app/controllers/concerns/issuable_collections.rb
View file @
0e09fdc9
...
...
@@ -40,7 +40,7 @@ module IssuableCollections
end
def
issues_collection
issues_finder
.
execute
.
preload
(
:project
,
:author
,
:
labels
,
:milestone
,
:assignees
,
project: :namespace
)
issues_finder
.
execute
.
preload
(
:project
,
:author
,
:
assignees
,
:labels
,
:milestone
,
project: :namespace
)
end
def
merge_requests_collection
...
...
lib/api/issues.rb
View file @
0e09fdc9
...
...
@@ -31,7 +31,7 @@ module API
params
:issue_params
do
optional
:description
,
type:
String
,
desc:
'The description of an issue'
optional
:assignee_id
,
type:
Integer
,
desc:
'The ID of a user to assign issue'
optional
:assignee_id
s
,
type:
Array
[
Integer
]
,
desc:
'The ID of a user to assign issue'
optional
:milestone_id
,
type:
Integer
,
desc:
'The ID of a milestone to assign issue'
optional
:labels
,
type:
String
,
desc:
'Comma-separated list of label names'
optional
:due_date
,
type:
String
,
desc:
'Date string in the format YEAR-MONTH-DAY'
...
...
@@ -156,7 +156,7 @@ module API
desc:
'Date time when the issue was updated. Available only for admins and project owners.'
optional
:state_event
,
type:
String
,
values:
%w[reopen close]
,
desc:
'State of the issue'
use
:issue_params
at_least_one_of
:title
,
:description
,
:assignee_id
,
:milestone_id
,
at_least_one_of
:title
,
:description
,
:assignee_id
s
,
:milestone_id
,
:labels
,
:created_at
,
:due_date
,
:confidential
,
:state_event
,
:weight
end
...
...
spec/fixtures/api/schemas/public_api/v4/issues.json
View file @
0e09fdc9
...
...
@@ -33,17 +33,20 @@
},
"additionalProperties"
:
false
},
"assignee"
:
{
"type"
:
[
"object"
,
"null"
],
"properties"
:
{
"name"
:
{
"type"
:
"string"
},
"username"
:
{
"type"
:
"string"
},
"id"
:
{
"type"
:
"integer"
},
"state"
:
{
"type"
:
"string"
},
"avatar_url"
:
{
"type"
:
"uri"
},
"web_url"
:
{
"type"
:
"uri"
}
},
"additionalProperties"
:
false
"assignees"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
[
"object"
,
"null"
],
"properties"
:
{
"name"
:
{
"type"
:
"string"
},
"username"
:
{
"type"
:
"string"
},
"id"
:
{
"type"
:
"integer"
},
"state"
:
{
"type"
:
"string"
},
"avatar_url"
:
{
"type"
:
"uri"
},
"web_url"
:
{
"type"
:
"uri"
}
},
"additionalProperties"
:
false
}
},
"author"
:
{
"type"
:
"object"
,
...
...
@@ -68,7 +71,7 @@
"required"
:
[
"id"
,
"iid"
,
"project_id"
,
"title"
,
"description"
,
"state"
,
"created_at"
,
"updated_at"
,
"labels"
,
"milestone"
,
"assignee"
,
"author"
,
"user_notes_count"
,
"milestone"
,
"assignee
s
"
,
"author"
,
"user_notes_count"
,
"upvotes"
,
"downvotes"
,
"due_date"
,
"confidential"
,
"web_url"
,
"weight"
],
...
...
spec/requests/api/issues_spec.rb
View file @
0e09fdc9
...
...
@@ -788,7 +788,7 @@ describe API::Issues, api: true do
expect
(
json_response
[
'updated_at'
]).
to
be_present
expect
(
json_response
[
'labels'
]).
to
eq
(
issue
.
label_names
)
expect
(
json_response
[
'milestone'
]).
to
be_a
Hash
expect
(
json_response
[
'assignee
'
]).
to
be_a
Hash
expect
(
json_response
[
'assignee
s'
]).
to
be_a
Array
expect
(
json_response
[
'author'
]).
to
be_a
Hash
expect
(
json_response
[
'confidential'
]).
to
be_falsy
expect
(
json_response
[
'weight'
]).
to
be_nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment