API: Issue relation create does not work

Added by Eser Esen 6 months ago

using postman /issues/15658/relations.json

with headers

  • Content-Type:application/json
  • X-Redmine-API-Key:...

and payload

{
    "relations": [
        {
            "issue_id":"15657",
            "relation_type":"follows",
            "delay": 0
        }
    ]
}

always returns 422 with error message

{
    "errors": [
        "Related issue cannot be blank" 
    ]
}

what is wrong here, i tried mulitple structures. API documentation for issue relation is very unclear about that.

Replies (3)

RE: API: Issue relation create does not work - Added by Sachin Khanna 3 months ago

Eser Esen wrote:

using postman /issues/15658/relations.json

with headers

and payload

[...]

always returns 422 with error message

[...]

what is wrong here, i tried mulitple structures. API documentation for issue relation is very unclear about that.

I have same issue

RE: API: Issue relation create does not work - Added by Mayama Takeshi 3 months ago

If you are also getting "Related issue cannot be blank", this is because you are using parameter "issue_id" instead of "issue_to_id".
Eser Esen's payload sample should have been:

{
    "relations": [
        {
            "issue_to_id":"15657",
            "relation_type":"follows",
            "delay": 0
        }
    ]
}

(1-3/3)