summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-08-01 09:03:14 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-08-01 09:03:14 +0000
commit6cccf59cb447fed490c5975e8e7fec6d28b2446b (patch)
tree8c12a210e89ee6060b3aaa4a351f5d18ed95afaa /lib/api
parent7586693e0b3e7f0e0bacdd8da082f901031e1c98 (diff)
parente72388246b0ab9badfd96cc5888b8d4807daeb89 (diff)
downloadgitlab-ce-6cccf59cb447fed490c5975e8e7fec6d28b2446b.tar.gz
Merge branch '1756-set-iid-via-api' into 'master'
Resolve "Allow issue's Internal ID (`iid`) to be set when creating via the API" Closes #1756 See merge request gitlab-org/gitlab-ce!20626
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/issues.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 25185d6edc8..bda05d1795b 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -162,6 +162,9 @@ module API
desc: 'The IID of a merge request for which to resolve discussions'
optional :discussion_to_resolve, type: String,
desc: 'The ID of a discussion to resolve, also pass `merge_request_to_resolve_discussions_of`'
+ optional :iid, type: Integer,
+ desc: 'The internal ID of a project issue. Available only for admins and project owners.'
+
use :issue_params
end
post ':id/issues' do
@@ -169,9 +172,10 @@ module API
authorize! :create_issue, user_project
- # Setting created_at time only allowed for admins and project owners
+ # Setting created_at time or iid only allowed for admins and project owners
unless current_user.admin? || user_project.owner == current_user
params.delete(:created_at)
+ params.delete(:iid)
end
issue_params = declared_params(include_missing: false)