You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the YouTrackSharp Nuget package (version 2021.3.6) to create a work item for an existing issue should correctly create the work item in the issue.
YouTrack server on-prem, Build 2022.2.53793, Fri, Aug 19, 2022.
Actual behavior
The request fails with the following error:
YouTrackSharp.Generated.YouTrackErrorException : The HTTP status code of the response was not expected (400).
Status: 400
Response:
{"error":"Bad Request","error_description":"YouTrack is unable to locate an Me-type entity unless its ID is also provided","error_developer_message":"YouTrack is unable to locate an Me-type entity unless its ID is also provided"}
Could not find any reference to this error on my Google searches.
I've triple-checked that the data supplied on the method call is valid and everything "exists" on our YouTrack instance.
The bearer token used is valid and has the necessary service scopes for the operation.
Steps to reproduce the behavior
The following Xunit test triggers the error, you'll just have to supply valid values to the configuration options:
publicclassYouTrackWorkItemTests{privatereadonlyBearerTokenConnectionconnection;publicYouTrackWorkItemTests(){connection=newBearerTokenConnection("<youtrack instance url>","<bearer token>");}[Fact]publicasyncTaskShouldCreateTimeTrackingWorkItem(){// ArrangevarissueService=connection.CreateIssuesService();vartimeTrackingService=connection.CreateTimeTrackingService();varissueId="<an existing issue id from a project with time tracking enabled>";vardescription="<any description will do>";varduration=TimeSpan.FromHours(1);varauthor="<a valid user name with access to the project>";// Actvarissue=awaitissueService.GetIssue(issueId).ConfigureAwait(false);varworkItemTypes=awaittimeTrackingService.GetWorkTypesForProject(issue.GetField("projectShortName").AsString()).ConfigureAwait(false);varworkItem=newWorkItem(DateTime.UtcNow,duration,description,workItemTypes.First(),newAuthor{Login=author});varworkItemId=awaittimeTrackingService.CreateWorkItemForIssue(issue.Id,workItem);// AssertworkItemId.Should().NotBeNullOrEmpty().And.NotBeNullOrWhiteSpace();}}
Any help is appreciated! Thanks!
The text was updated successfully, but these errors were encountered:
Expected behavior
Using the YouTrackSharp Nuget package (version 2021.3.6) to create a work item for an existing issue should correctly create the work item in the issue.
YouTrack server on-prem, Build 2022.2.53793, Fri, Aug 19, 2022.
Actual behavior
The request fails with the following error:
Could not find any reference to this error on my Google searches.
I've triple-checked that the data supplied on the method call is valid and everything "exists" on our YouTrack instance.
The bearer token used is valid and has the necessary service scopes for the operation.
Steps to reproduce the behavior
The following Xunit test triggers the error, you'll just have to supply valid values to the configuration options:
Any help is appreciated! Thanks!
The text was updated successfully, but these errors were encountered: