【发布时间】:2015-07-13 08:49:12
【问题描述】:
我编写了一个网络脚本,它为trello card ID 生成特征编号并将其保存在数据库中。
我还创建了一个 webhook,它在 trello board 更改时执行
当我创建卡片时,webhook 向 callbackURL 发送请求,但该请求不包含有关事件的数据。它仅包含模型信息(关于板)。如何获取新卡的 ID?
{
"model"=>{
"id"=>"5204523d8d3432ff1a000a60",
"name"=>"#BOARD",
"desc"=>"",
"descData"=>nil,
"closed"=>false,
"idOrganization"=>"53aaf6e5309dc12a75111fbf",
"pinned"=>false,
"url"=>"https://trello.com/b/ABdAaJeO/board",
"shortUrl"=>"https://trello.com/b/ABdAaJeO",
"prefs"=>{
"permissionLevel"=>"org",
"voting"=>"disabled",
"comments"=>"members",
"invitations"=>"members",
"selfJoin"=>false,
"cardCovers"=>true,
"calendarFeedEnabled"=>true,
"background"=>"river",
"backgroundColor"=>nil,
"backgroundImage"=>"https://d2a2fgsv6pobq6.cloudfront.net/images/backgrounds/river/full.jpg",
"backgroundImageScaled"=>[
{
"width"=>2400,
"height"=>1600,
"url"=>"https://d2a2fgsv6pobq6.cloudfront.net/images/backgrounds/river/large.jpg"
},
{
"width"=>1024,
"height"=>683,
"url"=>"https://d2a2fgsv6pobq6.cloudfront.net/images/backgrounds/river/medium.jpg"
},
{
"width"=>320,
"height"=>213,
"url"=>"https://d2a2fgsv6pobq6.cloudfront.net/images/backgrounds/river/small.jpg"
}
],
"backgroundTile"=>false,
"backgroundBrightness"=>"dark",
"canBePublic"=>true,
"canBeOrg"=>true,
"canBePrivate"=>true,
"canInvite"=>true
},
"labelNames"=>{
"green"=>"",
"yellow"=>"Тесты",
"orange"=>"frontend",
"red"=>"bugs",
"purple"=>"инфраструктура",
"blue"=>"backend",
"sky"=>"проектирование",
"lime"=>"гипотеза",
"pink"=>"",
"black"=>""
}
},
"feature"=>{
}
}
附: 我们使用 Scrum,现在使用 Trello。对于每个功能,我们都会在 trello 中创建一张卡片。我们创建带有前缀的 git 分支,包含功能编号(f231_feature 等)。当我推送更改时,我想自动向 trello 卡添加评论。
我们为每个功能使用整数,但 trello 卡 ID 太长,我们无法使用它。 Trello 卡有整数代码(例如 URL https://trello.com/c/2zrZE33/231-trello 中的 231),但这些代码在一个板上是唯一的,它不适合我们,因为我们将完成的卡移动到其他板上。
【问题讨论】: