Project

General

Profile

Actions

Defect #37633

closed

API create issue relation method returns "406:Not Acceptable" error

Added by Tomoko Shimizu over 1 year ago. Updated over 1 year ago.

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

0%

Estimated time:
Resolution:
Cant reproduce
Affected version:

Description

I tried to create issue relation by Curl, but it failed.
Could you please let me know if there is a workaround?


My environment:

Redmine 4.2.5
MySQL 5.7
Ruby 2.7.5
Apache/2.4.54

Curl command
note: API key has been replaced by "xxx".

curl -v -H "Content-Type: application/json" -X POST --data-binary "@rel.json" -H "X-Redmine-API-Key: xxx" http://ServerName/issues/1880736/relations.json

rel.json

{
    "relation": {
            "issue_to_id": "1880711",
            "relation_type": "follows",
            "delay": 0
      }
}

Returned error message on console

\< HTTP/1.1 406 Not Acceptable

Error messeage in production.log
note: my name has been replaced by xxx.

Started POST "/issues/1880736/relations.json" for 127.0.0.1 at 2022-09-01 15:52:18 +0900
Processing by IssueRelationsController#create as JSON
  Parameters: {"relation"=>{"issue_to_id"=>"1880711", "relation_type"=>"follows", "delay"=>0}, "issue_id"=>"1880736"}
  Current user: xxx (id=xxx)
Completed 406 Not Acceptable in 990ms (ActiveRecord: 15.1ms)

ActionController::UnknownFormat (IssueRelationsController#create is missing a template for this request format and variant.

request.formats: ["application/json"]
request.variant: []):
</pre
Actions

Also available in: Atom PDF