Capabilities
Client Library
Color Theme Compliance (Beta)
UI Functions

t.board()

t.board('id', 'name', ...)

Ask Trello for information on specific properties of the current board.

1
2
window.TrelloPowerUp.initialize({
  "board-buttons": function (t, opts) {
    return t.board("all").then(function (board) {
      console.log(JSON.stringify(board, null, 2));
    });
  },
});
1
2
window.TrelloPowerUp.initialize({
  "board-buttons": function (t, opts) {
    return t.board("id", "name").then(function (board) {
      console.log(JSON.stringify(board, null, 2));
    });
  },
});

Allowed Fields

id, name, url, shortLink, members, dateLastActivity, idOrganization, customFields, labels, memberships, paidStatus

You may pass in 'all' instead of individual fields to get all the fields for that model. This is also true for t.list() and t.card().

t.list()

t.list('id', 'name', ...)

1
2
window.TrelloPowerUp.initialize({
  "card-buttons": function (t, opts) {
    return t.list("all").then(function (list) {
      console.log(JSON.stringify(list, null, 2));
    });
  },
});

Allowed Fields

id, name, cards

t.lists()

t.lists('id', 'name', ...)

Get information on all open lists on the board. Takes the same field options as t.list.

1
2
window.TrelloPowerUp.initialize({
  "board-buttons": function (t, opts) {
    return t.lists("all").then(function (lists) {
      console.log(JSON.stringify(lists, null, 2));
    });
  },
});

t.card()

t.card('id', 'name', ...)

1
2
window.TrelloPowerUp.initialize({
  "card-buttons": function (t, opts) {
    return t.card("all").then(function (card) {
      console.log(JSON.stringify(card, null, 2));
    });
  },
});

Allowed Fields

id, name, desc, start, due, dueComplete, closed, cover, attachments, members, labels, checklists, url, shortLink, idList, idShort, dateLastActivity, badges, customFieldItems, coordinates, address, locationName, pos

t.cards()

.cards('id', 'name', ...)

Get information on all visible cards on the board. Takes the same field options as t.card.

1
2
window.TrelloPowerUp.initialize({
  "board-buttons": function (t, opts) {
    return t.cards("all").then(function (cards) {
      console.log(JSON.stringify(cards, null, 2));
    });
  },
});

Visible cards are cards that are open (i.e. not archived) and in open lists. Cards that are either closed (i.e. archived) or inside archived lists are not considered visible.

checkItems are not guaranteed to be available in the checklists field when using t.cards(). The best way to get check item information is to either use the individual t.card() function in a card context, or use the API.

t.member()

t.member('id', 'fullName', ...)

1
2
var t = window.TrelloPowerUp.iframe();

return t.member("all").then(function (member) {
  console.log(JSON.stringify(member, null, 2));
});

Allowed Fields

id, fullName, username, avatar, initials

t.memberCanWriteToModel()

t.memberCanWriteToModel('card')

Determine whether the current member can write data on a certain model. Useful for example if trying to determine if the current user of your Power-Up can attach an item to a card with t.attach

Synchronously returns true or false

1
2
window.TrelloPowerUp.initialize({
  'card-buttons': function (t, opts) {
    console.log(t.memberCanWriteToModel('card'));
    return [];
  }
});

Allowed ModelType: board, card, organization

t.isMemberSignedIn()

Synchronously determine if your Power-Up is being used by a logged in Trello member. Keep in mind, that your Power-Up might be enabled on a public board that is being viewed and interacted with by someone who is not logged into Trello.

Returns true or false

1
2
window.TrelloPowerUp.initialize({
  'card-buttons': function (t, opts) {
    console.log(t.isMemberSignedIn());
    return [];
  }
});

Privacy Controlled Fields

Some fields on the member can be put under privacy controls (See Member Object sub-heading on Member Object documentation). When a user selects a privacy setting other than public for their avatar or fullName, calls to t.member asking for either of those fields will change.

If fullName is set to anything other than public, the value returned from t.member('fullName') will be the same as t.member('username').

If avatar is set to anything other than public, calls to t.member('avatar') will return null. This is the same response you'd receive currently if the user did not have an avatar set.

t.organization()

t.organization('id, 'name')

Get information about the organization (Workspace) that the current board is in (if any).

1
2
var t = window.TrelloPowerUp.iframe();

return t.organization("all").then(function (organization) {
  console.log(JSON.stringify(organization, null, 2));
});
1
2
var t = window.TrelloPowerUp.iframe();

return t.organization("id", "name").then(function (organization) {
  console.log(JSON.stringify(organization, null, 2));
});

Allowed Fields

id, name, paidStatus

Private Organizations

A board may be in a private Workspace (organization) for which the current member using your Power-Up isn't in and therefore can't see. In that case you won't be able to get organization details via t.organization.

If you still need the id of the organization, you can use t.board('idOrganization')

Rate this page: