HOWTO: Create A New Version Number From The Command Line

During my release process, I want to make sure that YouTrack has the released version in its version list.

Even though I use TeamCity integration, I couldnt find an automated way to get the released versions into YouTrack.

So I came up with the following script using curl. It works with windows or unix, just get a copy of curl built for your system (google it)

First make an empty file, and name it "empty", then issue the following 2 commands:

curl "http://{yourserver}/rest/user/login" -d "login={yourlogin}&password={yourpassword}" -c yt

curl "http://{yourserver}/rest/admin/project/{yourproject}/version/{yournewversion}" -b yt --upload-file empty

If you use hosted yourserver is :

{yourdomainname}/youtrack

It could probably be improved by marking the version as released and setting the date.

0
6 comments
Avatar
Permanently deleted user

Jon,


You are right, teamcity integration in 2.0 doesn't create version, only build number.

Can you describe in more details, how do you expect this automatic version creation should work?

P.S. Thanx for script :-)

0

I think there might be a few different opinions, but having the version numbering work just like the tagging process would probably make the most sense, since quite often you tag your releases.


As an aside - now that you support multiple build steps - these things could be implemented as build steps instead of options on the main build.

Just a suggestion.

0
Avatar
Permanently deleted user

Jon,

In youtrack 3.0 teamcity integration supports arbitrary command execution for issues from assemdled build:

Screenshot-1.png

May be this helps to implement your scenario.



Attachment(s):
Screenshot-1.png
0

AFAIK there is no youtrack command to create a new version number. Has this changed?

0
Avatar
Permanently deleted user

No, you still can't create version with command.

But you can create tag with command - "tag my new tag" :-)

0

Ah that sounds similar to what I was suggesting; You are right.

0

Please sign in to leave a comment.