Francisco Puga
Francisco Puga

Reputation: 25158

Update issue journals of redmine through Rest API

I need to create new notes in existent issues of Redmine. It will be better that this can be accomplished through the Rest API, but i'm open to other solutions.

In some parts of the doc it seems to be possible, but in others it's written (soon) as if it does not be implemented jet.

I found this post asking the same, but without response.

I've already try it and in the log appear:

Processing IssuesController#update to json (for 127.0.0.1 at 2012-01-12 16:07:03) [PUT] Parameters: {"format"=>"json", "action"=>"update", "id"=>"8", "controller"=>"issues"} Completed in 34ms (View: 0, DB: 4) | 200 OK [http://localhost/issues/8.json]

But it's not really updated. I'm using this command to make the request

curl -v -H "Content-Type:text.json" -X PUT --data "@/tmp/8.json" -u admin:admin http://localhost:3000/issues/8.json

and the content of 8.json is:

{
    "issue": {
      "subject": "subject123",
      "notes":"funciona el rest"
      }
}

I thing that annoys me is that i'm using port 3000 but it seems to be ignored in the log response.

Upvotes: 4

Views: 3042

Answers (1)

Eric Davis
Eric Davis

Reputation: 1837

That JSON should work. You don't want to work with the journals themselves, you want to update the issue and add a new note. That way Redmine will create the journal for you.

Is the subject getting updated? Do you have the REST API enabled? Is the admin account allowed to update that issue?

You can also try putting the notes outside of the issues object:

{
    "issue": {
      "subject": "subject123"
     },
     "notes":"funciona el rest"
}

Upvotes: 2

Related Questions