Class: Member

TrelloEntities.Member(data)

The Member class represents a Member in Trello.

You will usually deal with Member as part of an IterableCollection or returned from Board and Card methods, however the Trellinator class is a special instance of Member, so when you do new Trellinator() the object you get back inherits all the behaviour of Member.

Constructor

new Member(data)

Parameters:
Name Type Description
data

(Object} key/value pairs of information, must at least contain "id" or a "username", but can basically just pass in response from Trello API

Source:
Examples
card.members().first().name();
new Trellinator().board("Some Board");
new Trellinator().team("Some Team");
new Member({username: "iaindooley"});

Members

(static) Member.mock_member_username

If you need to test adding a particular member by username to a card based on some action, you can use this mock_member_username to inject a different username to use when loading any member by username

Source:
Example
new Notification(posted).board().id();

Methods

(static) this.board(name)

Return a board this member has access to

Parameters:
Name Type Description
name string | RegExp

a string or RegExp to match against the board names

Source:
Example
new Trellinator().board("My Personal Tasks");

(static) this.boards(name)

Return an IterableCollection of boards this member has access to, filtered optionally by name using a string or regex

Parameters:
Name Type Description
name string | RegExp

a string or RegExp to match against the name of boards this member has access to

Source:
Example
new Notification(posted).member().boards(new RegExp("Internal.*"));

(static) this.card()

If a containing card has been set, return it otherwise throw InvalidDataException

Source:
Example
new Notification(notification)
.addedMemberToCard()
.card()
.postComment("Member added to me");

(static) this.customSticker()

Fetch a custom sticker by name

Source:
Example
card.members().first().id();

(static) this.customStickers()

Fetch a list of custom sticker IDs for use with the Card.addSticker method

Source:
Example
new Trellinator().customStickers();

(static) this.fullName()

Return the full name of this Member

Source:
Example
var notif = new Notification(posted);
notif.replyToMember("Your name is: "+notif.member().fullName());

(static) this.id()

Return the id of this Member

Source:
Example
card.members().first().id();

(static) this.name()

Return the username of this Member

Source:
Example
card.members().first().name();

(static) this.notTrellinator()

If this member is NOT the Trellinator member, useful for excluding functionality when a notification is caused by an action performed by Trellinator

Source:
Example
var notif = new Notification(posted);

if(notif.member().notTrellinator())
    notif.replyToMember("Your wish is my command!");

(static) this.team(name)

Return a team this member has access to, or create a new team if one doesn't exist

Parameters:
Name Type Description
name string

the team name

Source:
Example
new Trellinator().team("New or Existing Team");

(static) this.teams(name)

Return an IterableCollection of Teams this Member has access to, optionally filtered by a string/regex

Parameters:
Name Type Description
name string | RegExp

the string or RegExp to match with the team names

Source:
Example
new Trellinator().teams(new RegExp("Internal.*"));

(static) this.username()

Return the username of this Member this is an alias of the name() method

Source:
Example
card.members().first().username();