Project

General

Profile

Help for updating project custom field via API

Added by Dorice Nyamy over 2 years ago

Hello,

I am trying hard to update a project's custom field via API.

Here is the content of my params file

{"project":{
  "custom_fields": {
    "id": 40,
    "value": "Conception" 
  }
}}

As you can guess the custom field id is 40 and of type List, with 3 possible values : Conception, Revision, Finalization

My curl command recieve a HTTP/1.1 204 No Content response

Here is what I can see in log file

Processing by ProjectsController#update as JSON
  Parameters: {"project"=>{"custom_fields"=>{"id"=>40, "value"=>"Conception"}}, "id"=>"retreats-for-spiritual-progress"}
  Current user: dnyamy (id=5)
Completed 204 No Content in 84ms (ActiveRecord: 46.2ms)

Yet, when I check from UI, I see the field is not being updated

Please what am I doing wrong ?
Thanks and regards

Dn


Replies (1)

RE: Help for updating project custom field via API - Added by Dorice Nyamy over 2 years ago

Hello,
Issue identified and fixed
The right format for the params file is

{"project":{
  "custom_field_values": {
    "40": "Conception" 
  }
}}

Regards
Dn

    (1-1/1)