Project

General

Profile

Actions

Defect #20119

closed

REST API: setting project_id in issue not accepted in Redmine 3.0.3

Added by Alexander Muthmann almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
REST API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

Hi all,

I hope this is a mistake on my side but as far as I understand this might also be a bug in redmine.

If I try to post a new issue via the api to https://myredmine/issues.json I would use the following payload according to the documentation (http://www.redmine.org/projects/redmine/wiki/Rest_Issues):

{"issue": {
  "subject": "Test subject",
  "project_id": "myProject",
  "description": "foobar" 
  }
}

Redmine now does not create the ticket but responses with a 422 and

{"errors":["Project cannot be blank","Tracker cannot be blank","Status cannot be blank"]}

After some testing I found a working payload:

{"issue": {
  "subject": "Test subject",
  "description": "foobar" 
  },
  "project_id": "myProject" 
}

My Environment:

Environment:
  Redmine version                3.0.3.stable
  Ruby version                   2.1.2-p95 (2014-05-08) [x86_64-linux]
  Rails version                  4.2.1
  Environment                    production
  Database adapter               Mysql2

The issue does not show up on a 2.5.1 installation (both payloads work flawless):

Environment:
  Redmine version                2.5.1.stable
  Ruby version                   1.9.3-p194 (2012-04-20) [i486-linux]
  Rails version                  3.2.6
  Environment                    production
  Database adapter               Mysql2


Related issues

Related to Redmine - Defect #23766: API : creating issues with project identifier no longer possibleClosedJean-Philippe Lang

Actions
Is duplicate of Redmine - Defect #19276: Creating new issues with invalid project_id should return 422 instead of 403 errorClosedJean-Philippe Lang

Actions
Actions #1

Updated by Alexander Muthmann almost 9 years ago

I found a quick fix for me here:

in issues_controller.rb I reintegrated the method find_project and it's call in before_filter. This was removed in r13999
Most likely this is not the preferred way to solve it but this works as a quick fix for me.

Actions #2

Updated by Mischa The Evil almost 9 years ago

Please see #19276.

Actions #3

Updated by Alexander Muthmann almost 9 years ago

Thank you for this hint. I assume the change will be permanent and the calls to the api have to be changed to the "new" format.

Actions #4

Updated by Go MAEDA over 8 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

According to #19276-8, it is expected behavior.

Actions #5

Updated by Go MAEDA over 8 years ago

  • Is duplicate of Defect #19276: Creating new issues with invalid project_id should return 422 instead of 403 error added
Actions #6

Updated by Go MAEDA over 7 years ago

  • Related to Defect #23766: API : creating issues with project identifier no longer possible added
Actions

Also available in: Atom PDF