nests-for-trello icon indicating copy to clipboard operation
nests-for-trello copied to clipboard

Add link to parent board next to board name

Open tekNorah opened this issue 9 years ago • 6 comments

I would like to be able to easily click into the parent board from the child board. What do you think?

tekNorah avatar Sep 10 '15 08:09 tekNorah

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).

Sebmaster avatar Sep 10 '15 14:09 Sebmaster

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?

tekNorah avatar Sep 12 '15 03:09 tekNorah

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.

Sebmaster avatar Sep 12 '15 04:09 Sebmaster

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?

tekNorah avatar Sep 12 '15 06:09 tekNorah

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.

Sebmaster avatar Sep 12 '15 19:09 Sebmaster

I would be happy to give it a shot!

tekNorah avatar Sep 12 '15 19:09 tekNorah