Upload a workflow programmatically (REST API) ?

Hello,

I would like to know if there is a way to upload a workflow without going through the interface, something that can be used from a CI/CD for example.

There was an article written 9 years ago talking about a non documented API endpoint, maybe there's something new…

Thank you for your help.

0
1 comment

Hello,
I'm Stan from the YouTrack Team, I'll be glad to help! 

Yes, there's a supported CLI you can drop into a CI/CD pipeline: youtrack-app, from the @jetbrains/youtrack-apps-tools npm package. It's built for exactly this, keeping your workflow code in an external editor and syncing it to YouTrack:

  • youtrack-app list --host <url> --token <token> lists workflows on the instance
  • youtrack-app download <name> --host <url> --token <token> pulls one down
  • youtrack-app upload <dir> --host <url> --token <token> pushes local changes back

Authentication is via a permanent token, so there's no browser login step. That fits directly into automation. The account behind the token needs the Update Project permission, or Low-level Admin Write.

Full details are in Using an External Code Editor.

The endpoint from the old article still exists, but it was never documented or officially supported, so I'd recommend using the CLI above instead.

Please don't hesitate to reach out anytime if you have any questions or need any help!

0

Please sign in to leave a comment.