diff options
author | Jamie Schembri <jamie@schembri.me> | 2018-08-01 12:03:14 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-01 12:03:14 +0300 |
commit | e72388246b0ab9badfd96cc5888b8d4807daeb89 (patch) | |
tree | 8c12a210e89ee6060b3aaa4a351f5d18ed95afaa /lib/api | |
parent | 7586693e0b3e7f0e0bacdd8da082f901031e1c98 (diff) |
Resolve "Allow issue's Internal ID (`iid`) to be set when creating via the API"
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/issues.rb | 6 |
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) |