简体   繁体   中英

Trello power-up get the Board's ID on Initialize

Is there a way to get the current ID of the board currently using the power-up?

something like this in my client.js

var Promise = TrelloPowerUp.Promise;

TrelloPowerUp.initialize({
    // Start adding handlers for your capabilities here!
  'current-board': function(t, options){
    console.log(boardId) // I want to get the board's Id
  },

    'card-buttons': function(t, options) {
    return t.set("member", "shared", "hello", "world")
    .then(function(){
        return [{
        icon: BLACK_ROCKET_ICON,
              text: 'Estimate Size',
              callback: function(t) {
                return t.popup({
                  title: "Estimation",
                  url: 'estimate.html',
                });
              }
            }];
    })
    },
});

when the powerup is Initialize I want to console log the board Id .

The following code can be used inside your client.js file to fetch the board id or name and so on.

TrelloPowerUp.initialize({
    'current-board': function(t, options){
    t.board('id')
        .then(function (name) {
            console.log(name);
    });
});

The above code works for t.board('name') as well as for cards like t.card('name') .

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