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
Comment actions Permalink
Official comment

Hi! 

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: https://www.jetbrains.com/help/youtrack/incloud/v1-IssueAttachment.html

You can attach a file via a REST request, though. Please check our guide to learn how you can do it: https://www.jetbrains.com/help/youtrack/standalone/api-usecase-attach-files.html

>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: https://www.jetbrains.com/help/youtrack/standalone/Workflow-Tutorial.html

If you have any questions, please let me know.

Please sign in to leave a comment.