Creating a draft issue via API

I am trying to simplify the workflow for QA when they want to create a new issue from our game. My ideal workflow is: click a button in-game, the game creates a draft issue, attaches log files and screenshots and then opens the newly-created draft issue in the user's browser for them to edit and submit.

My reason for wanting to keep these as drafts is I don't want our YouTrack to become messy with half-finished issues.

I've seen how to create non-draft issues in the API and attach files. But how do I create draft issues?

1 comment
Comment actions Permalink

Hi,

Thank you for contacting YouTrack forums. I'm sharing an example of creating a draft with summary and description:

curl -X POST 'https://<YouTrack address>/api/admin/users/me/drafts?fields=description,updated,applicableActions(description,id)' -H 'Authorization: Bearer <token>' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -d '{"project":{"shortName":"SP"},"summary":"Hey draft!","description":"I am a draft"}'

The created draft can be later found in the Drafts section of the user whose token was used in the request. Please note that a draft can belong to its creator only, so they will be visible only to one user.

Please feel free to adjust this request further to modify custom fields or include attachments. Hope it helps. 

0

Please sign in to leave a comment.