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

Missing API methods #30

Open
andykirk opened this issue Apr 6, 2018 · 2 comments
Open

Missing API methods #30

andykirk opened this issue Apr 6, 2018 · 2 comments

Comments

@andykirk
Copy link

andykirk commented Apr 6, 2018

Me again.

So far as I can tell, the following methods are missing:

'getCustomFields' => ['get', 'customFields/%s'],

https://developers.trello.com/v1.0/reference#customfieldsid-3

'getCustomFieldsOptions' => ['get', 'customFields/%s/options'],

https://developers.trello.com/v1.0/reference#customfieldsidoptions-1

'getCustomFieldsOption' =>  ['get', 'customFields/%s/options/%s'],

https://developers.trello.com/v1.0/reference#customfieldsidoptionsidcustomfieldoption-3

Or something along those lines. The Trello docs seem to state both customFields and customField inconsistently - I think the cURL example is a typo.

Cheers.

@gnutix
Copy link

gnutix commented Apr 7, 2018

For the curious : if you want to fetch the custom fields information from a card, you can do the following :

$client->getBoardCards(
    'xXxXxXx', // board ID
    [
        'customFieldItems' => true,
    ]
);

Which add the following to each card array :

  "customFieldItems" => array:1 [
    0 => array:5 [
      "id" => "xXxXxXx"
      "value" => array:1 [
        "text" => "your custom value..."
      ]
      "idCustomField" => "xXxXxXx"
      "idModel" => "xXxXxXx"
      "modelType" => "card"
    ]
  ]

See https://developers.trello.com/v1.0/docs/getting-started-custom-fields#section-getting-customfielditems-for-cards

@andykirk
Copy link
Author

andykirk commented Apr 9, 2018

@gnutix thanks for that.
I recently discovered that myself (#27 (comment)) and I plan to submit a PR explaining that in the docs somewhere.

Cheers

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

2 participants