0

i am trying to use the redmine API to create new issue via code, just to test it i am trying to send the data to the API using postman. i have used amazon to host it.

I try send json via post method. (using postman -plugin for chrome)

url:- http://{user_name}:{password}@xxxredmine_urlxxx/issues.json

type:- POST

Body:-

{
    "issue": {
        "project_id": 1,
        "subject": "New ticket via API",
        "description": "API test 27\/6",
        "status_id": 1,
        "priority_id": 3,
        "assigned_to_id": 5
    }
}

it creates a ticket successfully but never sets an assignee

    {
  "issue": {
    "id": 61,
    "project": {
      "id": 1,
      "name": "EasySoft"
    },
    "tracker": {
      "id": 1,
      "name": "Bug"
    },
    "status": {
      "id": 1,
      "name": "New"
    },
    "priority": {
      "id": 3,
      "name": "High"
    },
    "author": {
      "id": 1,
      "name": "UserName LastName Admin"
    },
    "subject": "New ticket via API",
    "description": "API test 27/6",
    "start_date": "2016-06-27",
    "done_ratio": 0,
    "custom_fields": [
      {
        "id": 2,
        "name": "Customer name",
        "value": ""
      }
    ],
    "created_on": "2016-06-27T09:37:58Z",
    "updated_on": "2016-06-27T09:37:58Z"
  }
}

i have tried changing assigned_to_id to

"assigned_to":{"id":5}

Thank you in advance.

rohan
  • 21
  • 7

1 Answers1

0

This is an old question but potentially still useful to answer... are you certain that the user you are attempting to set as the assignee is in an assignable role on that specific project? Unfortunately, the Redmine REST API will respond with a 200 OK even if you give it a non-assignable user, so there's no indication that it was unable to successfully set the user as the assignee.

  • before passing the number i got the list of id's from redmine API so that i do not pass wrng id, also all users in redmine were given authority of assignment in that project. – rohan Nov 16 '16 at 10:23