Update assignees through API?

Hello,

Update assignees through API?
I have tried all variants I can think of on how to correctly update the assignee_ids of a task. Some examples:

{'task': {'assignee_ids': [123456]}, 'parse': True, 'with_notes': True}
{'task': {'assignee_ids[]': [123456]}, 'parse': True, 'with_notes': True}
{'task': {'assignee_ids[]': ['123456']}, 'parse': True, 'with_notes': True}

etc.

What’s the correct way to do it?

Thank you in advance!

Kind regards,
Jonas

1 Like

FIXED
So simple, but yet so hard to find… and when I now look at the data examples I added to my post above, it was also staring me right in the face… :laughing:

The cause:
The update_task function in the python client by default sets ‘parse’ to True!

I.e. this doesn’t work:

{'task': {'assignee_ids': [123456]}, 'parse': True, 'with_notes': True}

while this works great:

{'task': {'assignee_ids': [123456]}, 'parse': False, 'with_notes': True}

The python client library:
The project page:

I have added this param:

        assignee_ids: Optional[List[int]] = None,

I have added this to the Args documentation:

            assignee_ids: List of user IDs to assign to the task.

I have added this to the code:

        if assignee_ids is not None:
            data.update(assignee_ids=assignee_ids)
            if parse:
                raise ValueError('parse cannot be True when updating assignee_ids.')

I will make a pull-request.

1 Like

Hello @jola16 ,

In fact, the problem is that parse parameter is not handled correctly in Checkvist. We will fix it, but it is better to skip it at all if you don’t need parsing (and you don’t need it, when you want to set assignee_ids).

Sorry for the problem :frowning:

Kind regards,
KIR

1 Like