定制 alessandrominoccheri/trello-cycle-time 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alessandrominoccheri/trello-cycle-time

Composer 安装命令:

composer create-project alessandrominoccheri/trello-cycle-time

包简介

A library to get cycle time of trello cards

README 文档

README

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

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固