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

How to create a new issue? #95

Open
WKleinschmit opened this issue Mar 24, 2020 · 3 comments
Open

How to create a new issue? #95

WKleinschmit opened this issue Mar 24, 2020 · 3 comments

Comments

@WKleinschmit
Copy link

Hello,
I'm using version 2019.2.0 on a version on a 2019.2 server and I want to create a new issue.
This is my code:

                        BearerTokenConnection connection = new BearerTokenConnection(
                            "https://youtrack.example.com/",
                            "perm:Ym...Dfg");

                        IIssuesService issuesService = connection.CreateIssuesService();

                        YouTrackSharp.Issues.Issue ytIssue = new YouTrackSharp.Issues.Issue
                        {
                            Summary = summary,
                            Description = descriptionBuilder.ToString(),
                        };

                        string ytIssueID = await issuesService.CreateIssue("SIMNC", ytIssue);

During the call to CreateIssue my program just ends without any error message and the issue is not created.
What am I doing wrong?

@maartenba
Copy link
Contributor

Nothing, it seems :-) Code is similar to the test we have here, so that should be good.

Any chance you could try to add a try/catch around it or use another means of capturing the unexpected end of your app?

@WKleinschmit
Copy link
Author

I've tried the same call using the RestSharp library and it turns out the issue creation fails with a "BadRequest" response due to some workflow that is denying access. (Issue to our IT is pending,)

But still, that should not make the whole program just vanish.
And no, a try/catch block around the call does nothing. Looks like there is no exception to catch, the program is just aborted.

@maartenba
Copy link
Contributor

YouTrackSharp throws an exception when this happens, the app/.net runtime should be able to handle that gracefully.

Wondering if you have some code we could use to reproduce the issue?

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

2 participants