0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Trello で、特定のステータスのタスク名一覧を取得したい

Posted at

やりたいこと

ボード「My Tasks」に「TODO」というリストがあり、その中に「TaskA」「TaskB」「TaskC」というタスクがあるとき、以下のような出力を得たい

TaskA
TaskB
TaskC

スクリプト

以下のように、curl と jq を利用して実現できる。

  • list_id
  • api key
  • token

の 3つの情報が必要となる。取得方法は後述する。

curl --request GET \
  --url 'https://api.trello.com/1/lists/<list_id>/cards?key=<api key>&token=<token>' \
  --header 'Accept: application/json' \
  | jq -r '.[].name'

list_id の取得

下記の方法で、対象としたいリストの ID を取得する。

Trello API: getting boards / lists / cards information - Stack Overflow

api key, token の取得

下記ページを参照して、 api key, token の情報を取得する。

API Introduction (atlassian.com)

余談

余談だが、私はここから更に、パイプをつなげてメールを送信している。

curl --request GET \
  --url 'https://api.trello.com/1/lists/<list_id>/cards?key=<api key>&token=<token>' \
  --header 'Accept: application/json' \
  | jq -r '.[].name' \
  | mail -s "Today's Task" -r <送信元アドレス> <宛先アドレス>

Ref

API エンドポイントの情報

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?