"Subject cannot be blank" issue with REST API

Added by Brian Davidson over 2 years ago

I am currently trying to get the REST API up and running with a Ruby form. I've hardcoded values in while I try to figure out how to get the post working correctly, but I am having some issues.

I know in the API, it says you can create an issue by using POST /issues.[format], but I can't seem to get it to post. This is my form tag in ruby that I currently have and I've attached a screenshot of the error I get when I click submit on the form.

<%= form_tag('MyURL/issues.xml?project_id=2&tracker_id=18&subject=test&status_id=2', authenticity_token: 'Redmine form authenticity token', method: "post", :class => "ticket_form") do %>

Any guidance is greatly appreciated. Also, I'm not familiar with Ruby at all, so more simple the explanation is, the better.

Screenshot from 2016-01-04 12_09_18.png - Error when trying to post (13.9 KB)

Replies (4)

RE: "Subject cannot be blank" issue with REST API - Added by Peter Boguszewski 10 months ago

I am getting the same error - did you ever find an answer to this problem?

Thanks (I know this is a bit old of an issue but it does hurt to try),

Pete

RE: "Subject cannot be blank" issue with REST API - Added by Pavel Kim 6 months ago

Peter Boguszewski wrote:

I am getting the same error - did you ever find an answer to this problem?

Thanks (I know this is a bit old of an issue but it does hurt to try),

Pete

My 'bot' wasn't a member of the project it was trying to create a new issue into.
So, perhaps, check you ACL.

RE: "Subject cannot be blank" issue with REST API - Added by Fred Amaro about 1 month ago

I have the same problem.

Does anybody knows an answer to this problem?

RE: "Subject cannot be blank" issue with REST API - Added by Mayama Takeshi about 1 month ago

As far as I know, you cannot pass the data about the issue you want to create in the URL querystring.
You must send a body containing XML (or JSON, according to the suffix in the URL: issues.xml or issues.json).

(1-4/4)