RestSharp POST request translation from cURL request
A clean and more reliable solution you could use is described below:
var client = new RestClient("http://{URL}/rest/api/2");var request = new RestRequest("issue/", Method.POST);client.Authenticator = new HttpBasicAuthenticator("user", "pass");var issue = new Issue{ fields = new Fields { description = "Issue Description", summary = "Issue Summary", project = new Project { key = "KEY" }, issuetype = new IssueType { name = "ISSUE_TYPE_NAME" } }};request.AddJsonBody(issue);var res = client.Execute<Issue>(request);if (res.StatusCode == HttpStatusCode.Created) Console.WriteLine("Issue: {0} successfully created", res.Data.key);else Console.WriteLine(res.Content);
The full code I uploaded to gist: https://gist.github.com/gandarez/50040e2f94813d81a15a4baefba6ad4d
Jira documentation:https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-create-issue