Project

General

Profile

"Subject cannot be blank" issue with REST API

Added by Brian Davidson over 8 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.


Replies (5)

RE: "Subject cannot be blank" issue with REST API - Added by Peter Boguszewski over 6 years 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 about 6 years 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 almost 6 years 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 almost 6 years 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).

RE: "Subject cannot be blank" issue with REST API - Added by Holger Bruch 11 months ago

I struggled a while with that issue. The error message is not very clear. Be sure to re-read the API documentation. I.e. you need to pass the appropriate Content-Type header (see https://www.redmine.org/projects/redmine/wiki/rest_api#Specify-Content-Type-on-POSTPUT-requests). Check that the property names match exactly (lowercase).
And finally wrong IDs might cause this issue also.

    (1-5/5)