1

I'm trying to make a little app which updates redmine issues. To start with I wanted to test the API calls to make sure I knew what I'm doing and already hit a wall.

I fired up postman with a PUT URL

http://address:port/issues/1.json

headers:

Content-Type:application/json
X-Redmine-API-Key:MYKEY
X-Redmine-Switch-User:MYUSERNAME

body:

{"issue": { "id":"5729", "subject": "This change happens", "status": { "id": "1", "name": "This change is ignored" }  } } 

However when I hit send and look in redmine only the subject has been updated, the status doesn't change. I can see also that the last updated field updates to the current time/date.

I've seen several answers to questions like this already, but the solution always seems to be adding the content type to the header... and I've already got that.

Am I missing something obvious?

Here is my redmine environment if relevant:

Environment:
  Redmine version                2.5.1.stable
  Ruby version                   1.9.3-p0 (2011-10-30) [i386-mingw32]
  Rails version                  3.2.17
  Environment                    production
  Database adapter               PostgreSQL
SCM:
  Subversion                     1.8.13
  Mercurial                      3.4
  Git                            1.9.5
  Filesystem                     
Redmine plugins:
  clipboard_image_paste          1.8
  redmine_backlogs               v1.0.6
  redmine_ckeditor               1.0.16
  redmine_dashboard              3.0.0.dev0
  redmine_issue_checklist        2.0.5
  redmine_questions              0.0.5
  redmine_release_notes          1.3.1
  redmine_repobrowser            1.3.0
  redmine_user_specific_theme    0.0.1
  redmine_wiki_extensions        0.6.3
  redmine_wiki_lists             0.0.3
4

1 回答 1

0

根据http://www.redmine.org/projects/redmine/wiki/Rest_Issues#Updating-an-issue,看起来您应该只传递状态 ID,如“status_id”。你能试试这样的东西吗?

{"issue":
    {
    "id":"5729",
    "subject": "This change happens",
    "status_id": "1"
    }
}
于 2016-12-22T16:04:42.717 回答