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
Hi @Atifa Fahmeen -- Welcome to the Atlassian community!
I believe this will return the issue types and their attributes. Substitute your company's URL and project name.
MyCompanyURL/rest/api/2/issue/createmeta?projectKeys=MYPROJECT&expand=projects.issuetypes.fields
Please look here for more information:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.