ruby-trello
ruby-trello copied to clipboard
[Feature Request] Allow finding boards for an organization instead of member
Hello,
On my app, I need to fetch all boards of my organization workspace and not only the boards that my API user has joined.
To do this I had to do the following code because Trello::Board.all
is scoped on Trello::Member.find(:me)
:
boards = Trello::Board.from_response(
Trello::Board.client.get("/organizations/[my org ID]/boards", filter: "open", fields: "id,name")
)
Also this code allowed me to pass query parameters as mentioned in the API documentation and made the request a lot lighter and faster.
Maybe Trello::Board.all
could accept extra parameters to allow another scope and query parameters ?
Regards Quentin
I'll take a look in the next few days.
We have an API to fetch all boards of an organization(workspace)
organization = Trello::Organization.find(org_id)
boards = organization.boards
But it's using a legacy API /organizations/#{id}/boards/all
which doesn't support query parameters. I will fix it to use /organizations/#{id}/boards
with parameter support.
@qdegraeve I just bump to v4.2.0. Now you can use query paramters:
organization = Trello::Organization.find(org_id)
boards = organization.boards(filter: "open", fields: "id,name")
Please have a test and hope it can help.
Thank you very much, I'll give it a try.