nests-for-trello
nests-for-trello copied to clipboard
Add link to parent board next to board name
I would like to be able to easily click into the parent board from the child board. What do you think?
Sadly I don't think that's really possible - there's no way to link a board up to a parent card in the same way as I currently do card => board (except doing weird workarounds like hidden cards on a hidden list, which kinda sucks).
hmmm... can't just have a button at the top of the board next to the name, and the code would search for the first board that has a card with a link to that board on it and create a link on the child board to the parent board?
The problem is that I'd expect the search to be quite slow, especially when a user has lots of boards/big boards. Maybe it'd be possible to "abuse" the Trello search api for that purpose - I'm not sure how it handles the fact that the comment is hidden, it might not index it for the search.
You use the Trello API? Even better. I would do this:
First, search through all cards with a specified board shortcode in the description. Will return all cards with the Card IDs.
GET https://api.trello.com/1/search?key={key}&token={token}&query={boardshortcode}&card_fields=desc
Then, Parse out the Card IDs from cards/e/id into a list and Iterate the card id list. Will return card info, which includes the Board IDs.
In the iterate loop:
GET https://api.trello.com/1/cards/{cardid}?key={key}&token={token}
Then, Parse out the Board IDs from item/o/url into a list and iterate the Board ID list. Will return board info, which includes the Board Short URLs
https://api.trello.com/1/boards/{BoardId}?key={key}&token={token}
Then, Parse out the Board Short URLs from item/o/shortUrl into a list and Iterate the Board ShortUrl list.
Regex, if you need to for your logic, to strip out the Board Short ID using:
https://trello.com/b/(.*)
Use this to build a list of buttons to parent boards.
Does this help? What do you think?
Yeah, that's what I meant with
Maybe it'd be possible to "abuse" the Trello search api for that purpose - I'm not sure how it handles the fact that the comment is hidden, it might not index it for the search.
It sounds like it could work. If you're willing to PR those changes I'd merge them.
I would be happy to give it a shot!