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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
b9dfd071
Commit
b9dfd071
authored
Mar 28, 2018
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include subgroup issues when searching for group issues using the API
parent
db555cb7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
changelogs/unreleased/issue_42443.yml
changelogs/unreleased/issue_42443.yml
+5
-0
lib/api/issues.rb
lib/api/issues.rb
+1
-1
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+24
-0
No files found.
changelogs/unreleased/issue_42443.yml
0 → 100644
View file @
b9dfd071
---
title
:
Include subgroup issues when searching for group issues using the API
merge_request
:
author
:
type
:
added
lib/api/issues.rb
View file @
b9dfd071
...
@@ -97,7 +97,7 @@ module API
...
@@ -97,7 +97,7 @@ module API
get
":id/issues"
do
get
":id/issues"
do
group
=
find_group!
(
params
[
:id
])
group
=
find_group!
(
params
[
:id
])
issues
=
paginate
(
find_issues
(
group_id:
group
.
id
))
issues
=
paginate
(
find_issues
(
group_id:
group
.
id
,
include_subgroups:
true
))
options
=
{
options
=
{
with:
Entities
::
IssueBasic
,
with:
Entities
::
IssueBasic
,
...
...
spec/requests/api/issues_spec.rb
View file @
b9dfd071
...
@@ -384,6 +384,30 @@ describe API::Issues do
...
@@ -384,6 +384,30 @@ describe API::Issues do
end
end
let
(
:base_url
)
{
"/groups/
#{
group
.
id
}
/issues"
}
let
(
:base_url
)
{
"/groups/
#{
group
.
id
}
/issues"
}
context
'when group has subgroups'
,
:nested_groups
do
let
(
:subgroup_1
)
{
create
(
:group
,
parent:
group
)
}
let
(
:subgroup_2
)
{
create
(
:group
,
parent:
subgroup_1
)
}
let
(
:subgroup_1_project
)
{
create
(
:project
,
namespace:
subgroup_1
)
}
let
(
:subgroup_2_project
)
{
create
(
:project
,
namespace:
subgroup_2
)
}
let!
(
:issue_1
)
{
create
(
:issue
,
project:
subgroup_1_project
)
}
let!
(
:issue_2
)
{
create
(
:issue
,
project:
subgroup_2_project
)
}
before
do
group
.
add_developer
(
user
)
end
it
'also returns subgroups projects issues'
do
get
api
(
base_url
,
user
)
issue_ids
=
json_response
.
map
{
|
issue
|
issue
[
'id'
]
}
expect_paginated_array_response
(
size:
5
)
expect
(
issue_ids
).
to
include
(
issue_1
.
id
,
issue_2
.
id
)
end
end
it
'returns all group issues (including opened and closed)'
do
it
'returns all group issues (including opened and closed)'
do
get
api
(
base_url
,
admin
)
get
api
(
base_url
,
admin
)
...
...
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