Using an External Code Editor
You can use the web-based workflow editor to make a quick edit or write a simple rule. But if you’re used to working in a full-featured development environment, you can actually write your workflows in any IDE that supports JavaScript.
To let you work where you're most comfortable, we've put together and published two packages that you can import into your code editor.
Package Installation
To work with the scripting package, you need to install and run Node.js. This also installs the npm package manager that lets you work with the scripting package in your projects.
Next, install the package in your development environment. The installation process varies based on the tool that you use to write your code. If you’re working with an IDE from JetBrains, follow the instructions provided in the documentation:
The easiest way to get started is to install the package globally with the following command:
npm install -g <package name>
@jetbrains/youtrack-scripting-api
The first package contains the complete YouTrack workflow API. When you plug this package into your code editor, your code-completion tools suggest valid functions, methods, and properties for all of the entities that are available in the API.
@jetbrains/youtrack-scripting
The second package contains utility scripts that help manage YouTrack workflows when you work in an external code editor. This lets you write and update workflows for YouTrack in JavaScript in your preferred development environment.
The package includes scripts that let you synchronize local changes with your YouTrack installation. The following commands are available:
Command | Description |
---|---|
list | This command lists all of the workflows that are available in your YouTrack installation. To use this command, specify the following parameters:
|
download | This command downloads the referenced workflow from your YouTrack installation. youtrack-workflow download <workflowName> [--output] |
upload | This command uploads the workflow from the specified directory to your YouTrack installation. First, the script checks the reference directory for a youtrack-workflow upload <dir> |