Hello Team,
We need to post a comment on task using Asana API , is that possible ? if yes please let me ping possible ways and API link.
If not - please provide us a alternative way to do post a comment on task.
Thanks in advance!!
Hello Team,
We need to post a comment on task using Asana API , is that possible ? if yes please let me ping possible ways and API link.
If not - please provide us a alternative way to do post a comment on task.
Thanks in advance!!
Yes, itâs possible! Comments are called Stories
in the Asana API. Use this API endpoint to create a new story on a task:
Hi How can I do it in Asana 3.2.1 ? api_response = client.tasks.create_story_for_task(
task_gid=task_gid, opt_fields=opt_fields
) this method didnât work ?
Hi @Jakub_Cielepak and welcome,
What client library is that? Python? Node?
HI @Phil_Seeman Python, asana version 3.2.1
Hi @Jakub_Cielepak,
Hereâs how you would make that request with our Python V3.2.1 version
import asana
client = asana.Client.access_token('<YOUR_PERSONAL_ACCESS_TOKEN>')
result = client.stories.create_story_for_task('<YOUR_TASK_GID>', {'text': 'This is a comment'})
TIP: you can see check how to do this in our developer docs under âPYTHON-OLDâ (these sample codes are for python client library versions <= V3.2.1)
Thank you ! @John_Vu @Phil_Seeman
By using API, can we add who created that comment and when it was created?
No. The author of the comment will be the owner of the authenticated Asana account thatâs adding it via the API, and the date/time canât be specified in the call.
OK, thanks for clarifying.
In addition, I would like to know whether we can add replies to comments using the REST API, which would mean there will be my parent comment, and multiple replies for that comment
Is it possible to post a comment and attach an attachment to it at the same time using REST API?
@Teja_Korgaonkar - to answer your first question (replies), no. Asana doesnât have a concept of threading in comments (in the API or in the UI).
For your second question, I believe these have to be two separate actions: post the comment and upload the attachment
ok. Thank you for your response.
In addition to the this, can we include a line break tag in html_text while adding comment using REST Api? \n is not working for line break.