How to create an Issue in the Project with attached file on JavaScript?

Hi. I'm newbie in Youtrack, so please do not punish me for stupid questrions :)

I need to create a Workflow on JavaScript, where on create of new Issue in the Project, the attachment (as Excel template file of agreements of administration to give rights to user) will be added to this Issue. Administration must edit this Excel file and save it, so this file needs to be updated in this Issue.

Please, let me know, where Excel file needs to be placed in file system for attach to new Issue?

And I never seen syntax, please, give me an example of JavaScript code. Thank you!

1 comment
Official comment


I'm Sergey from the Youtrack Team. 

I replied to your direct support request a couple of hours ago. Just in case, I will share the reply here as well: 

You can't upload a file to an issue through a Javascript workflow. You can see the documentation of what you can do here:

You can attach a file via a REST request, though. Please check our guide to learn how you can do it:

>And I never seen syntax, please, give me an example of JavaScript code, how to attach this template to new Issue created.

Please check our Workflow Tutorial:

If you have any questions, please let me know.

Please sign in to leave a comment.