Create time entry with custom fields via API

Added by Stanley Rogasik about 1 month ago

Hi,

I'm having trouble creating a time entry via API.
The time entry have few custom fields. I've tried XML and JSON. It still reports that the custom fields are not set.
Here's my body:

<time_entry>
    <project_id>238</project_id>
    <user_id>2</user_id>
    <activity_id>8</activity_id>
    <hours>7.0</hours>
    <comments>time entry comment</comments>
    <spent_on>2012-12-28</spent_on>
    <custom_fields type="array">
        <custom_field id="36">
            <value>Zdalna</value>
        </custom_field>
    </custom_fields>
</time_entry>

Response from redmine:

<?xml version="1.0" encoding="UTF-8"?>
<errors type="array">
    <error>Typ dniówki nie może być puste</error>
    <error>Projekt nie może być puste</error>
    <error>Projekt jest nieprawidłowe</error>
    <error>Zagadnienie nie może być puste</error>
</errors>

I tried everything and it seems that there's not so much alike problems.
Could anybody help me? Or at least show me it's body?