trello
trello copied to clipboard
Attachment Not Working
Hi all Thanks for this good working but examples are missing. I am trying to add a card with attachment. I did it without any error but no attachment on Trello.
var attachs []*trello.Attachment attachs = append(attachs, &trello.Attachment{URL:"https://www.belightsoft.com/products/imagetricks/img/[email protected]", Name:"test"})
card := &trello.Card{ Name: "Batur Orkun", Desc: "Card description", Attachments: attachs, } err = list.AddCard(card, trello.Defaults())
I could have added by using AddFILEAttachment() method after adding a Card. But there is another problem is getting ID of Card I added. Because I need this ID for adding an attachment after.
card := &trello.Card{ ID: "aaaaa" .....} . command does not work
Thanks for the report. I'll take a look this week.
Having the same issue. Any update?
I was able to investigate. The list.AddCard()
method is a pass through to the POST .../cards API call, which doesn't accept attachments at the time of card creation. It looks like that method could be modified to make a second API call if the incoming struct has attachments (I'd want to preserve the exact current functionality for structs that don't have attachments). Please submit a PR if you'd like to add this feature. I'll leave this as an open feature request and try to get to it, but it might not be fast.
@adlio great work with the trello client 🙌
Do you think this issue is the same with labelIDs
and AddCard
?
I stumbled across the same problem when I use list.AddCard(&card)
and the labels are included in the trello.Card
struct. When I execute this, there are 0 tags included in the card created, while when I create the card and then call the AddIDLabel
it works as expected.
This is a bummer because with this approach adding multiple labels will require multiple requests (greater chance of a failure), but definitely not a roadblock.