簡體   English   中英

如何獲取基於 position 的 trello 卡

[英]How to get a trello card based on position

我正在嘗試獲取特定列表中的頂級 Trello 卡,但我不確定如何從基於其 position 的列表中獲取卡。 有任何想法嗎? 此外,我對 Trello API 非常了解,我根本無法弄清楚這一點。

到目前為止我有這個,但我不知道如何獲得頂級卡。

let listID = "5ec3fda8a26c384e44f063bb";

trello.getCardsOnListWithExtraParams(listID, "pos:top",
  function(error, trelloCard) {
    if (error) {
      console.log('An error occured with Trello card.' + error)
      message.channel.send({
        embed: {
          color: 0xff604d,
          description: "An error occured! Please try again later or use the support server link."
        }
      });
    } else {
      console.log('Found card:', trelloCard);
    }
  });

當我使用您的代碼並將 [0] 添加到它記錄的 trelloCard 時,它工作正常並獲得列表中的第一個。

trello.getCardsOnListWithExtraParams(listID, "pos:top",
      function (error, trelloCard) {
          if (error) {
              console.log('An error occured with Trello card.' + error)
           //testing this in console so I removed the message.channel.send
          }
          else {
              console.log('Found card:', trelloCard[0]);
          }
        })

輸出:

...
name: 'two',
pos: 0.5,
...

這是第一個

特雷羅截圖

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM