Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get YouTrack build number #75

Closed
MarkHutchings opened this issue Apr 25, 2018 · 7 comments
Closed

Get YouTrack build number #75

MarkHutchings opened this issue Apr 25, 2018 · 7 comments

Comments

@MarkHutchings
Copy link

No description provided.

@MarkHutchings
Copy link
Author

MarkHutchings commented Apr 25, 2018

I've added this myself as an extension to Connection for now:

        public class BuildVersionResult
        {
            [JsonProperty( "build" )]
            public string Build;
        }

        public static async Task<BuildVersionResult> BuildVersion( this Connection connection )
        {
            var httpClient = await connection.GetAuthenticatedHttpClient();
            var client     = httpClient;
            var response   = await client.GetAsync($"api/config?fields=build" );
            response.EnsureSuccessStatusCode();

            var str = await response.Content.ReadAsStringAsync();

            var f = JsonConvert.DeserializeObject<BuildVersionResult>( str );

            return f;
        }

@maartenba
Copy link
Contributor

@MarkAudax do you happen to have a link to the documentation in the REST API for this one?

@maartenba maartenba changed the title Please add API to get YouTrack build number Get YouTrack build number Apr 25, 2018
@maartenba
Copy link
Contributor

Let me see if I can add it.

maartenba added a commit that referenced this issue Apr 25, 2018
@MarkHutchings
Copy link
Author

That was quick, thanks very much!

@maartenba
Copy link
Contributor

Release will be done later today. Thanks @MarkAudax for suggesting! (and PR's are always welcome :))

@MarkHutchings
Copy link
Author

Perfect - I have forked and I'll get set up for PRs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants