summaryrefslogtreecommitdiff
path: root/lib/api/issues.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-07-27 09:59:38 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-07-27 09:59:38 +0000
commit5e56890e31d40c9ac47991d1d454f44f4ee5b0c2 (patch)
tree87af43b83c76fda47e7ad299e50e3cfef8afbf5d /lib/api/issues.rb
parent2e483ca9e3cd2ff25d6ae0a69d2d9b5fcea7267c (diff)
parentd8798c907dfb960856423422a91eb1e6dc8db090 (diff)
downloadgitlab-ce-5e56890e31d40c9ac47991d1d454f44f4ee5b0c2.tar.gz
Merge branch 'tc-issue-api-assignee' into 'master'
Add author_id & assignee_id param to /issues API Closes #29430 See merge request !13004
Diffstat (limited to 'lib/api/issues.rb')
-rw-r--r--lib/api/issues.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 93ebe18508d..009c6d6bcd4 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -29,6 +29,10 @@ module API
optional :search, type: String, desc: 'Search issues for text present in the title or description'
optional :created_after, type: DateTime, desc: 'Return issues created after the specified time'
optional :created_before, type: DateTime, desc: 'Return issues created before the specified time'
+ optional :author_id, type: Integer, desc: 'Return issues which are authored by the user with the given ID'
+ optional :assignee_id, type: Integer, desc: 'Return issues which are assigned to the user with the given ID'
+ optional :scope, type: String, values: %w[created-by-me assigned-to-me all],
+ desc: 'Return merge requests for the given scope: `created-by-me`, `assigned-to-me` or `all`'
use :pagination
end
@@ -55,9 +59,11 @@ module API
optional :state, type: String, values: %w[opened closed all], default: 'all',
desc: 'Return opened, closed, or all issues'
use :issues_params
+ optional :scope, type: String, values: %w[created-by-me assigned-to-me all], default: 'created-by-me',
+ desc: 'Return merge requests for the given scope: `created-by-me`, `assigned-to-me` or `all`'
end
get do
- issues = find_issues(scope: 'authored')
+ issues = find_issues
present paginate(issues), with: Entities::IssueBasic, current_user: current_user
end