Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to add issues with custom fields in Redmine REST API?

How can I create issues with custom fields? I am using the CakePHP HTTP client. I have tried:

$http = new Client();
$rqs  = $http->post('http://**********/redmine/issues.json', [
    'key'=>'************************************',
    'issue'=> [
        'custom_fields' => [['id'=>119,'value'=>'11','name'=>'IDFinanceiro']],
        'project_id'=>53,
        'status_id' =>1,
        'assigned_to_id'=>42,
        'subject'=>$registro->denominacao.' - '.$registro->gruporeceitasdespesa->denominacao,
        'description'=> 'Valor: '.$registro->valor.'\\r\\nData: '.$registro->dia.'\\r\\nObservação: '.$registro->observacao.'\\r\\nTabela Financeiro: '.$registro->planilhafinanceiro_id,
    ]
]);

but it is not working: the issue is created, but custom fields are null.

Versions:

Environment:

Redmine version 3.4.2.stable.16963

Ruby version 2.3.1-p112 (2016-04-26) [x86_64-linux-gnu]

Rails version 4.2.8

Comments