JetBrains / YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
https://www.jetbrains.com/youtrack
Apache License 2.0
134 stars 105 forks source link

Client 2020.1.0 does not work from today #106

Closed kolibaba closed 3 years ago

kolibaba commented 3 years ago

Yesterday API version 2020.1.0 worked (the project uses .Net 4.8, so we use this version). Today I went wrong with an error:

The code: connection = new BearerTokenConnection ("https: // [some name] .myjetbrains.com / youtrack", "[token]"); connection.CreateIssuesService (). GetIssues (...);

Error: System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).

How to solve this in a project for .Net 4.8?

PS We tried a project on .net 5.0 and version YoutTrackSharp 2021.3.1, we get an error:

Unhandled exception. YouTrackSharp.UnauthorizedConnectionException: Could not authenticate. Server did not return expected authentication response. Check the Response property for more details. at YouTrackSharp.BearerTokenConnection.GetAuthenticatedApiClient () at YouTrackSharp.Issues.IssuesService.GetIssues (String filter, Nullable1 skip, Nullable1 take, Boolean wikifyDescription, Boolean wikifyContents)

maartenba commented 3 years ago

The older library uses a now deprecated API in YouTrack - https://blog.jetbrains.com/youtrack/2021/02/discontinuing-the-legacy-rest-api-action-required/

The new release of this library supports the new API's. Some breaking changes are documented in https://github.com/JetBrains/YouTrackSharp/releases/tag/2021.3.0

kolibaba commented 3 years ago

Do I understand correctly that the new version of YouTrackSharp cannot be used in our project, because it uses .net 4.8?

maartenba commented 3 years ago

The library targets netcoreapp3.1 (.NET Core 3.1 and up)