0
votes

I am trying to use TechTalk.JiraRestClient to create an issue in jira. Below is what I've gotten so far

        JiraClient client = new JiraClient(url, username, password);
        var txt = client.GetIssues("JPA"); //this gets all the issues for that board.
        IssueFields fields = new IssueFields();
        fields.summary = "Create a ticket via automation.";
        fields.description = "This is a test ticket. This ticket was created via automation";
        fields.timetracking.originalEstimate = "0";
        var txt2 = client.CreateIssue("JPA", "Bug", fields);

I am unable to create the ticket as it throws the following error:

TechTalk.JiraRestClient.JiraClientException was unhandled HResult=-2146233088 Message=Could not create issue Source=TechTalk.JiraRestClient

InnerException:

ErrorResponse={"errorMessages":[],"errors":{"timetracking":"Field 'timetracking' cannot be set. It is not on the appropriate screen, or unknown."}} HResult=-2146233088 Message=JIRA returned wrong status: Bad Request Source=TechTalk.JiraRestClient StackTrace: at TechTalk.JiraRestClient.JiraClient`1.AssertStatus(IRestResponse response, HttpStatusCode status) at TechTalk.JiraRestClient.JiraClient'1.CreateIssue(String projectKey, String issueType, TIssueFields issueFields) InnerException:

Even when I remove the timetracking field it throws the same error. I don't know how to resolve this. Any help would be great!

Thanks - KP

1

1 Answers

0
votes

Setting the timetracking to null should solve this problem.

fields.timetracking = null;