I'm using JIRA cloud.
Trying to use the API to create JIRA issues, but I got following error when I tried to set the summary field.
{"errorMessages":[],"errors":{"summary":"Field 'summary' cannot be set. It is not on the appropriate screen, or unknown."}}
final ClientConfig clientConfig = new ClientConfig();
final BasicAuthSecurityHandler basicAuthHandler =
new BasicAuthSecurityHandler("username", "password");
clientConfig.handlers(basicAuthHandler);
final RestClient winkClient = new RestClient(clientConfig);
final Resource resource =
winkClient.resource("https://cnwyjira.atlassian.net/rest/api/2/issue");
final ClientResponse response = resource
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.post("{\"fields\":{\"project\":{\"id\":\"10001\"},\"issuetype\":{\"id\":\"10000\"},\"summary\":{\"JiraRestAPI\"}}}");
System.out.println(response.getEntity(String.class));
However, I was able to update the summary field by creating an new issue first via JIRA UI.
final Resource resource = winkClient
.resource("https://cnwyjira.atlassian.net/rest/api/latest/issue/EDI-19604");
final ClientResponse response = resource
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.put({\"fields\":{\"summary\":\"REST API Updated Summary\"}});Please help! Thanks~