2016-03-09 70 views
0

我已经建立了拉从Trello注释中使用此代码来显示它在我的网站的网站获取活动:如何从trello板

var resource = "cards/" + card.id + "/actions"; 
    Trello.get(resource, function(comments) { 
      if(!$.isEmptyObject(comments)){ 
        var commentStr="<div class='comments_c'>"; 
        $.each(comments, function(c, cda){ 
          //console.log(cda.data.text); 
          commentStr += "<p>"+cda.data.text+"</p>"; 
          //addComments(cda.data.text); 
        }); 

        commentStr += "</div>"; 
      } 
      console.log(commentStr); 

现在它工作正常拉评论,但它不” t显示像“Sarah Hastings添加此卡片”这样的活动。 api文档没有提及它,而我处于死胡同。我们需要它来进行报告,并寻找一种方法来从Trello到我们的网站获取活动(复制,移动,添加)。任何帮助表示赞赏。

回答

0

默认情况下,cards/[idCard]/actions端点将返回的操作过滤为commentCard,updateCard:idList。如果您想要从该端点获取其他类型的操作,则需要将filter参数与要返回的操作类型列表一起包含。您可以看到这里记录的完整选项列表:https://developers.trello.com/advanced-reference/card#get-1-cards-card-id-or-shortlink-actions通过点击在该调用的参数旁边显示

例如,将卡添加到电路板的操作将是:moveCardToBoard,因此您需要将其添加到过滤器参数中。