How to get Comment's attachments using api

Hi Greetings,

i’ve stuck in a problem, i need your help asap please.

Asana api is allowing me to get attachments via task id. thats fine.
but i want to get those attachments which are under some comment.
How can i get attachments using comment id, or let me know any solution please.

Thanks

I think there’s absolutely no method to get that information. The document added with the comment is in the attachments collection as any other comment, and there’s no property to tell that it was added with the comment.

Even in the stories, you see that the comment have been added, but there’s NO story for that document being added to the task !! (I think it’s a bug Asana should fix…)

There’s one solution you can try, but it’s not 100% accurate, but it can help if you need to link a comment with a document…

Look at the “created_at” of that document, + “create_at” of stories.

If you find a story that is added less than 10 seconds from a document, you can suppose that they were added simultaneously… ???

I just did a test, and there was less than 1 second between both.
attachment: “created_at”:
“2021-07-10T01:30:39.008Z”
comment (stories): “created_at”:
“2021-07-10T01:30:45.114Z”

But, look at my sample, the difference between them is 6 seconds !!! That’s very long…
I’m not sure you can use it, but you can try !

3 Likes

@Frederic_Malenfant, I think you’re 100% correct. It came up before here:

@Ross_Grambo or @AndrewWong, do you know why in the Asana UI, we can see an attachment on a comment but in the API, there’s seemingly no linkage available between attachment and story?

3 Likes

we need the information via API what attachement is added to what comment by comment ID, too.

since Asana have allowed adding attachments to comments just some month ago, Asana has not updated their API yet.
so that is something like a bug showing these attachements belonging to the task (when asking the API about attachments for tasks).

thanks for any message.

I am also searching for a similar solution, as I intend to duplicate my tasks and include all the elements within them, such as files within comments. It would be helpful to know the specific comments to which these files are related.

Hello everyone,
Does anyone have news about this?
Is it already possible to get comment attachments using API?
Thanks

There have not been any changes since the last post in this thread, sorry.

Hi @Krina_Pestro and welcome to the forum,

I’ve merged your post with an existing thread on this topic.

Unfortunately as you can read in the thread, there is currently no known way to get the attachments that are connected to a story (which is the API object for a task comment).