简体   繁体   中英

Access Card Members in Trello Powerup Card Button Popup

We are building a Trello Powerup to capture feedback information into a separate set of services (Rails app). To do this we have a Card button that creates a popup for an iframe similar to the example found in card-buttons capabilities .

As part of this iframe, we'd like the Trello Powerup user to see and check card members. Unfortunately, in the iframe we only have the cid or card id.

The only way we see to do this nicely is to use the Trello Card Members API endpoint with the cid . This would require the user to have OAuthed their Trello account with our site/service. Totally possible, but not the greatest experience.

Another option might be query string, but it's ugly. Using the card data method we could encode each member's avatarHash , user_id , and fullName in the iframe url.

Are these the only options? Can I add new data to the iframe context ?

card-buttons automatically use t.signUrl , so there is no opportunity to add arguments to the data Trello automatically sends. It is possible, however, to access the t variable t variable through the iframe() method.

I haven't tried this code (although I know without t.sizeTo('#page'); the attachment section will have a scrollbar), but it should work in your iframe:

var t = TrelloPowerUp.iframe();
t.card('members').then(function (values) {
  console.log(values);
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM