How can I create a draft via API on behalf of Reporter user?
Hi,
How can I create a draft via API on behalf of Reporter user?
curl --location 'https://site.com/api/issues/XX-123/draftComment?fields=id' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer perm:reporter-token' \
--data '{
"text": "another comment"
}'
It works with Standard user but not with Reporter.
Thanks.
Please sign in to leave a comment.
Hi!
It's not possible to create comments or issues via REST API on behalf of the Reporter, I'm afraid.
Hi,
we can create token for the Reporter:
and then we can use it to create issue or comment.
And this is convenient, since we transfer tickets for clients from another system. The only thing missing is the ability to create drafts, because we need to attach client files to a draft before posting a response.
We can create issue from draft on behalf of Reporter (client), this also works fine:
If you block this possibility, it will break our entire development, which lasted more than two months… And we will be forced to stop using YouTrack and agent licenses.
Hi Viacheslav,
Unfortunately, it's not possible to create comment drafts with a predefined reporter with the YouTrack REST API.
Also, please note that the endpoint you're using to create comment drafts is not a public one and may be subject to change.
As a workaround, we can suggest creating a comment and then attaching a file to it in a separate transaction.
I hope this information will be helpful. Let us know if you have any further questions. We'll be happy to answer.