Iam creating issue by JiraRestClient in java. Iam able to set default fields from my code. I was also trying to set the priority of issue while creating the issue. But the field priority was not present in the context field list which resulted in this error and the issue was not created.
[ErrorCollection{status=400, errors={priority=Field 'priority' cannot be set. It is not on the appropriate screen, or unknown.}, errorMessages=[]}]
Is there a way to find out which fields are in use for an issueType(Im trying for issueType Task) in a particular project.
The way I can retrieve the issueTypes available for a project, I want to retrieve the fields which can be set. Im using this code to get the issuetypes:
JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
client = factory.createWithBasicHttpAuthentication(uri, task.getUsername(), task.getPassword());
IssueType issueType = null;
Iterator<IssueType> issueTypeItr = null;
issueTypeItr = client.getProjectClient().getProject(task.getIssueTrackerProjectName()).claim().getIssueTypes().iterator();
while (issueTypeItr.hasNext()) {
IssueType it = issueTypeItr.next();
if (it.getName().equalsIgnoreCase(task.getIssueTrackerIssueType())) {
issueType = it;
}
}
Similarly, how can we get the fields which are present in the list of fields