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

Request-URI Too Long #94

Closed WKleinschmit closed 3 years ago

WKleinschmit commented 4 years ago

Thr following code:

BearerTokenConnection ytConnection = new BearerTokenConnection(
 "https://youtrack.XXX.com/",
 "perm:...");

Issue issue = new Issue
{
    Description = description.ToString(),
    Summary = "Summary",
};

IIssuesService issuesService = ytConnection.CreateIssuesService();

string id = await issuesService.CreateIssue("XXX", issue);

Results in a System.Net.Http.HttpRequestException with the message "Response status code does not indicate success: 414 (Request-URI Too Long)."

What am I doing wrong here?

maartenba commented 4 years ago

Think that mostly depends on the length of the description and summary in the issue, could you try a shorter one?

WKleinschmit commented 4 years ago

I can try. But I need the (admitadly long) description. Is there a way to edit it after creation of the issue?

Also: Shouldn't the description be transmitted in the body of the request as stated here: https://www.jetbrains.com/help/youtrack/standalone/2019.2/api-howto-create-issue.html

maartenba commented 4 years ago

That's a newer API, we'll need some work to move from the older REST API...

WKleinschmit commented 4 years ago

Can't wait...

Jaben commented 4 years ago

@maartenba is there an ETA for to move to the newer REST API? Is the workaround to truncate the Summary or Description or both? If so, what is the max length?

Thanks.

maartenba commented 4 years ago

@Jaben There is no ETA right now.

As for max length, this should be ~10000 characters.

maartenba commented 4 years ago

@Jaben Regarding new API, if needed you can use the OpenAPI spec (https://www.jetbrains.com/help/youtrack/standalone/openapi-specification.html) and generate a client (e.g. using NSwagStudio). This may be the route we will take as well (with helpers for many methods)

rekolobov commented 3 years ago

Fixed by #105 and 2021.3.0 release