Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment Not Working #45

Open
baturorkun opened this issue Jul 4, 2019 · 5 comments
Open

Attachment Not Working #45

baturorkun opened this issue Jul 4, 2019 · 5 comments

Comments

@baturorkun
Copy link

baturorkun commented Jul 4, 2019

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/core-image-filters@2x.jpg", Name:"test"})

card := &trello.Card{
Name: "Batur Orkun",
Desc: "Card description",
Attachments: attachs,
}
err = list.AddCard(card, trello.Defaults())

@baturorkun
Copy link
Author

baturorkun commented Jul 5, 2019

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

@adlio
Copy link
Owner

adlio commented Jul 7, 2019

Thanks for the report. I'll take a look this week.

@adlio adlio changed the title examples? Attachment Not Working Jul 7, 2019
@KaziSadmanAhmed
Copy link

Having the same issue. Any update?

@adlio
Copy link
Owner

adlio commented Oct 9, 2019

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.

@konsalex
Copy link

konsalex commented Feb 8, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants