GithubHelp home page GithubHelp logo

trello-cycle-time's Introduction

Trello Cycle Time

Scrutinizer Code Quality Code Coverage Latest Stable Version License Build Status Total Downloads

This library is a PHP library to get cycle time of cards from a Trello board. With this tool you can seen how many times a card take to pass from a state to another state into the board.

Installation

You can install this package via composer like this:

composer require alessandrominoccheri/trello-cycle-time

How to use it?

To use this library you need to have:

  • Trello apikey
  • Trello token
  • Trello boardId to analyze

All Cards

To get all cards transitions column you can use this code for example

use TrelloCycleTime\Client\TrelloApiClient;

$client = new TrelloApiClient('apikey', 'token');
$board = new TrelloBoard($client, 'board-id');

$transitions = $board->getTransitions();

var_dump($transitions);

The response of getTransitions is an array that contains some information for example:

[0 => [
   'id' => 'cardId',
   'title' => 'cardName',
   'cycleTimes' => [
        0 => [
            'from' => 'Doing',
            'to' => 'Done',
            'days' => '6',
            'name' => 'Doing_DOne'
        ],
        1 => [
             'from' => 'ToDo',
             'to' => 'Doing',
             'days' => '1',
             'name' => 'ToDo_Doing'
        ]
   ]
]
];

In this case you can see that this card takes 1 day to pass from Todo to Doing and 6 days to pass from Doing to Done.

Specific card transition

To get only a specific card transition you can obtain it using its id like this:

use TrelloCycleTime\Client\TrelloApiClient;

$client = new TrelloApiClient('apikey', 'token');
$board = new TrelloBoard($client, 'board-id');

$transitions = $board->getCardTransitions('cardId');

var_dump($transitions);

The response of getTransitions is an array that contains some information only of that card for example:

[0 => [
   'id' => 'cardId',
   'title' => 'cardName',
   'cycleTimes' => [
        0 => [
            'from' => 'Doing',
            'to' => 'Done',
            'days' => '6',
            'name' => 'Doing_DOne'
        ],
        1 => [
             'from' => 'ToDo',
             'to' => 'Doing',
             'days' => '1',
             'name' => 'ToDo_Doing'
        ]
   ]
]
];

In this case you can see that this card takes 1 day to pass from Todo to Doing and 6 days to pass from Doing to Done.

Filters

You can filter column cards with some parameters. Here are some possible filters

From column to column

if you want to know only how much time alla cards or a single card passed from a column to column,

To do this you can use this code:

$transitions = $board->getTransitions(['fromColumn' => 'todo', 'toColumn' => 'done']);

or for a specific card:

$transitions = $board->getCardTransitions('cardId', ['fromColumn' => 'todo', 'toColumn' => 'done']);

From date to date

if you want to know only how much time alla cards or a single card passed filtered by from a date or to a date or together,

To do this you can use this code:

$transitions = $board->getTransitions(['fromDate' => '2019-01-01', 'toDate' => '2019-12-31']);
$transitions = $board->getTransitions(['fromDate' => '2019-01-01']);
$transitions = $board->getTransitions(['toDate' => '2019-12-31']);

or for a specific card:

$transitions = $board->getCardTransitions(['fromDate' => '2019-01-01', 'toDate' => '2019-12-31']);

Contributing

Every contribution is welcome, remember to add tests and use psalm and phpstan:

./vendor/bin/phpunit
./vendor/bin/psalm
./vendor/bin/phpstan analyse

trello-cycle-time's People

Contributors

alessandrominoccheri avatar

Watchers

 avatar  avatar

trello-cycle-time's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.