Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Field 'checked' changed to "checkbox' and this affects post_args because the post arg has remained unchanged #346

Open
xu2xulim opened this issue Jul 19, 2021 · 0 comments

Comments

@xu2xulim
Copy link

There is some inconsistency found in set_custom_fields for what used to be type = 'checked'

if custom_field.field_type in ['text', 'number', 'date', 'checked']:
            if value == "":
                post_args = {'value': ""}
            else:
                post_args = {'value': {str(custom_field.field_type): value}}

The Trello api documentation is as follows

The type of Custom Field to create.

Valid values: checkbox, list, number, text, date

But when updating a CF it is still using {'checked' : value}...below is copied from the example from Trello API document

{
  "value": {
    "text": "<string>",
    "checked": true,
    "date": "2018-03-13T16:00:00.000Z",
    "number": 2154
  }
}

Above seems to be validate during my test.
I changed
if custom_field.field_type in ['text', 'number', 'date', 'checked']:
to
if custom_field.field_type in ['text', 'number', 'date', '**checkbox**]:

and hardcoded this
post_args = {'value': {str(custom_field.field_type): value}}
as
post_args = {'value': 'checked' : value}}

and my code was able to execute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant