Project

General

Profile

Update issue api does not work

Added by Rajal Bhatt over 7 years ago

Hi,

I am updating the issue in redmine using rest API. However the issue gets updated sometimes and sometimes it doesn't update though I do not get any error from redmine API. Below is my update request:

http://localhost/issues/1193.json

header : Content-Type application/json

Body:

{
  "issue": {
    "id": 1193,
    "project": {
      "id": 1,
      "name": "abc" 
    },
    "tracker": {
      "id": 2,
      "name": "Feature" 
    },
    "status": {
      "id": 1,
      "name": "New" 
    },
    "priority": {
      "id": 2,
      "name": "Normal" 
    },
    "author": {
      "id": 1,
      "name": abc" 
    },
    "parent": {
      "id": 1187
    },
    "subject": "PQR",
    "description": "",
    "start_date": "2017-03-20",
    "due_date": "2017-03-20",
    "done_ratio": 0,
    "estimated_hours": 10,
    "total_estimated_hours": 10,
    "spent_hours": 0,
    "total_spent_hours": 0,
    "custom_fields": [
      {
        "id": 1,
        "name": "ID",
        "value": "" 
      },
      {
        "id": 2,
        "name": "Training Video",
        "value": "" 
      },
      {
        "id": 5,
        "name": "Shift",
        "value": "General" 
      },
      {
        "id": 6,
        "name": "TaskType",
        "value": "" 
      },
      {
        "id": 7,
        "name": "Start_timestamp",
        "value": "" 
      },
      {
        "id": 8,
        "name": "End_timestamp",
        "value": "" 
      },
      {
        "id": 9,
        "name": "ActualEnd_Timestamp",
        "value": "12:30" 
      },
      {
        "id": 10,
        "name": "ActualStart_Timestamp",
        "value": "12:35" 
      },
      {
        "id": 11,
        "name": "ActualDuration",
        "value": "56" 
      }
    ],
    "created_on": "2017-03-17T05:31:36Z",
    "updated_on": "2017-03-20T11:50:45Z" 
  }
}

Can you please help me here.

Thank you
Rajal


Replies (4)

RE: Update issue api does not work - Added by Rajal Bhatt about 7 years ago

I came to know that if any required field is null or an field is missing, then redmine does not update the issue. Please check if your log is saying something like "null value" for any field.

RE: Update issue api does not work - Added by Alexandre Mendonça Lima about 7 years ago

Thank you for trying to help me!

I'll check my log if something appears like 'null'.

RE: Update issue api does not work - Added by Alexandre Mendonça Lima about 7 years ago

Hi, Bhatt!

I follow an suggestion from other user and I found the problem.

It was a plugin. I disabled the plugin and now it worked. Maybe some field that plugin has using is null.

Thank you once more.

    (1-4/4)