Allow using markup when creating ticket comment via an API call
Maciej Duda
Related to https://api.clickup.com/api/v2/task/abcdef/comment API endpoint.
Allow using markdown syntax (tables, h1, embedded images etc) while adding a comment to a task.
It is possible to use markdown with markdown_content paragraph while creating a new task. I would expect the same behaviour for comments.
Log In
Martin Bachmann
Absolutely needed, and the same way we can use markdown using the tasks api.
P
Phieu Dinh
I'm on the same boat
It looks like posting markdown content via the /comments endpoint is just plain not possible at the moment
It's a huge blocker for us because we need to post some tables and their own comment node (https://clickup.com/api/developer-portal/commentformatting/) doesn't allow to use tables either
Maciej Duda
FYI there is a hidden feature in "Create Task Comment" API endpoint. It is possible to replace comment_text body parameter with markdown_content and use Markdown such as https://help.clickup.com/hc/en-us/articles/6309026707351-Markdown-shortcuts. Other syntax such as heading or table works too https://www.markdownguide.org/basic-syntax/
Gustavo Bresler
Maciej Duda: I have been trying to do so and haven't been successful. Would you mind sharing your request structure? Would be of great help. Thank you.
Maciej Duda
Gustavo Bresler:
POST payload:
{
"name": "some test",
"markdown_content": "## header 2\n\n| Name | some name here just one long line which should stretch the table |\n|-|-|\n|Name |Jill |"
}
Gustavo Bresler
Maciej Duda: Thank you for your reply. I've tried to do so, but it gives me an error [401] OAUTH_062: Comment is required. I've tried adding a comment array with the markdown_content inside as well, but that didn't work, as if the parameter is not identified. If you have any other tips, would be tremendously appreciated. Thank you.
Maciej Duda
Gustavo Bresler:
you have the authentication error. Check if your API key is in the "authorization" header.
Here is curl export. You have to replace YOUR_LIST_ID with your valid list id (it's in the URL, if you go to the list in clickup web ui.
-H 'authorization: YOUR_AUTHENTICATION_KEY' \
-H 'content-type: application/json' \
--data-raw $'{\n "name": "test 201",\n "markdown_content": "## header 2\\n\\n| Name | some name here just one long line which should stretch the table |\\n|-|-|\\n|Name |Jill |"\n}'
Gustavo Bresler
Maciej Duda: I was using the Comment API, this is why I got the error, but I've tried with the Update Task API as suggested. It didn't create a new comment, only substituted the description. I was using "markdown_description" for that, it does the same, I guess.
In my case, I wanted to include a Comment with Markdown, but that doesn't seem possible through the API. I thought that was what you had found out how to do. If that was something that you managed to do, kindly let me know, if not, I appreciate your help anyway. Thank you.
Gustavo Bresler
Maciej Duda: My workaround for the moment:
I will create a script to translate my text to this format: https://clickup.com/api/developer-portal/commentformatting/
And upload any files and attachments to the Task itself using the endpoint "Create Task Attachment"
Shaun Smekel
Maciej Duda this doesn't solve the problem for comments, only for creating tasks.
Mariusz Balon
Gustavo Bresler Can you share your script?