Skip to content

ballerina-platform/module-ballerinax-trello

Repository files navigation

Ballerina Trello connector

Build GitHub Last Commit GitHub Issues

Overview

Trello is a popular web-based project management and collaboration platform developed by Atlassian, allowing users to organize tasks, projects, and workflows using boards, lists, and cards.

The ballerinax/trello package provides APIs to connect and interact with Trello's RESTful API endpoints, enabling developers to seamlessly manage boards, lists, cards, and other Trello resources.

Setup guide

To use the Trello connector, you must have access to the Trello API through a Trello account and an API key and token generated from it. If you do not have a Trello account, you can sign up for one here. You can generate your Trello API key and token by following the instructions at Trello API Keys.

  1. Visit the Trello powerups admin page and create a new powerup

    trello powerup

  2. Enter the required details:

    • Name of your Power-Up
    • Iframe Connector URL (can be a placeholder URL during development) Click “Create” to create your Power-Up.

    trello powerup form

  3. Navigate to 'API Key' and click on 'Generate'

    generate trello apikey

    Copy and securely store your API Key.

  4. Next to the API Key description, there's a link to the token. Click the link, authorize the Power-Up, and you’ll be redirected to a page displaying your OAuth token.

    get trello Key

    allow token

    Copy and securely store the Token.

    trello token

Quickstart

To use the Trello connector in your Ballerina application, update the .bal file as follows:

Step 1: Import the module

Import the Trello module.

import ballerinax/trello;

Step 2: Instantiate a new connector

Create a Config.toml file and configure the obtained credentials as follows:

key = "your_api_key"
token = "your_api_token"

Step 3: Invoke the connector operation

Now, utilize the available connector operations.

Create a card

public function main() returns error? {
    trello:PostCardsQueries cardPayload = {
        idList: listId,
        name: "This is a sample card"
    };
    trello:Card createdCard = check trello->/cards.post({}, cardPayload);
    io:println("Card created: ", createdCard.name, " (ID: ", createdCard.id, ")");
}

Step 4: Run the Ballerina application

bal run

Examples

The Trello connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:

  1. Create and retrieve a list and cards in Trello - Create a new list in a specific Trello board and retrieve its details using the list ID.
  2. Create, update fetch and add a label to a card in Trello - Create a new card in a Trello list and update the card's name add a label to it and view it.

Build from the source

Setting up the prerequisites

  1. Download and install Java SE Development Kit (JDK) version 21. You can download it from either of the following sources:

    Note: After installation, remember to set the JAVA_HOME environment variable to the directory where JDK was installed.

  2. Download and install Ballerina Swan Lake.

  3. Download and install Docker.

    Note: Ensure that the Docker daemon is running before executing any tests.

  4. Export Github Personal access token with read package permissions as follows,

    export packageUser=<Username>
    export packagePAT=<Personal access token>

Build options

Execute the commands below to build from the source.

  1. To build the package:

    ./gradlew clean build
  2. To run the tests:

    ./gradlew clean test
  3. To build the without the tests:

    ./gradlew clean build -x test
  4. To run tests against different environments:

    ./gradlew clean test -Pgroups=<Comma separated groups/test cases>
  5. To debug the package with a remote debugger:

    ./gradlew clean build -Pdebug=<port>
  6. To debug with the Ballerina language:

    ./gradlew clean build -PbalJavaDebug=<port>
  7. Publish the generated artifacts to the local Ballerina Central repository:

    ./gradlew clean build -PpublishToLocalCentral=true
  8. Publish the generated artifacts to the Ballerina Central repository:

    ./gradlew clean build -PpublishToCentral=true

Contribute to Ballerina

As an open-source project, Ballerina welcomes contributions from the community.

For more information, go to the contribution guidelines.

Code of conduct

All the contributors are encouraged to read the Ballerina Code of Conduct.

Useful links

About

Ballerina Trello Connector

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 7