Problems posting issues to a private project via the REST API
I refer to this blog post Creating an alternative UI for YouTrack which I was using as a starting point hwoever the project I need to post to is not a public project so I therefore get 401 (Unauthorized) errors when attempting to post a new issue.
Thanks, Simon
- Can I post issues into a private project from a designated domain without passing login credentials? The reason for this is that for our users it is likely to be a barrier to them reporting issues if they have to login first.
Thanks, Simon
Please sign in to leave a comment.
My code is as follows:
function createIssue() { $.ajax({ url: "http://example.myjetbrains.com/youtrack/rest/user/login", dataType: "json", type: "POST", data: { login: $("#username").val(), password: $("#password").val() } }); $.ajax({ url: "http://example.myjetbrains.com/youtrack/rest/issue", dataType: "json", type: "POST", data: { project: 'PROJECT_NAME', summary: $("#summary").val(), description: $("#description").val() }, xhrFields: { withCredentials: true } }).done(function(data) { $("#result").show(); $("#summary").val(''); $("#description").val(''); }); }