REST API - how to set "Submitted by" field?
Hello guys,
I noticed that bug reports which are sent by YouTrack when it crashes are all submitted by "Exception Robot" user. I'm wondering if it's possible to set submitter either at the issue creation time (using /rest/issue/ POST request), or later, using commands with /rest/issue/execute/ request?
I think it would be quite natural that logged user would be used as a submitter but seems it's a bug in the API, and I already submitted a bug: http://youtrack.jetbrains.net/issue/JT-2435.
Just wondering how you do this for Exception Robot's issues ;-)
Thanks,
Alexey
Please sign in to leave a comment.
will answer myself - you need to login to the REST service (/rest/user/login) with desired user credentials. For the POST request, server will respond with 200 OK with "Set-Cookie" header. That header contains the cookie which must be reused in the following POST requests.
In C# this can be easily achieved with CookieContainer:
It will be automatically filled with the cookies from the http response.
Alexey.