Can not create issue via REST API - Field 'xxx' cannot be set. It is not on the appropriate screen, or unknown, when using workflow property "jira.permission.createclone.denied"
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When creating the issue via REST API, the user is getting the below error. Below is for "summary" field but it can come for other fields as well.
Field 'summary' cannot be set. It is not on the appropriate screen, or unknown.
Environment
Jira Datacenter version 9.x and above.
Diagnosis
The issue only happens when the user is creating the issue using REST API and doesn't happen when the same user creates the issue using Jira UI. The fields are also present on the appropriate screens.
Tomcat-access-logs
When this issue is encountered, the tomcat-access-logs will log the below entries and HTTP 400 response is returned.
172.10.20.30 123x1089278x2 abcd [27/Jun/2024:15:50:25 +0500] "POST /rest/api/2/issue/- HTTP/1.1" 400 1019 42 "-" "xyz" "zyxabc"
atlassian-jira.log
Atlassian-Jira logs will log the below errors for the same request:
2024-06-27 15:50:25,126+0500 http-nio-8080-exec-123 INFO abcd 123x1089278x2 xyz 11.22.333.444,172.10.20.30 /rest/api/2/issue/ [c.a.jira.security.WorkflowBasedPermissionManager] CREATE_ISSUES not granted by 'denied' workflow permission
2024-06-27 15:50:25,126+0500 http-nio-8080-exec-123 INFO abcd 123x1089278x2 xyz 11.22.333.444,172.10.20.30 /rest/api/2/issue/ [c.a.jira.security.WorkflowBasedPermissionManager] CREATE_ISSUES granted by permission scheme but DENIED by workflow
The above log lines indicates that there is some property at the workflow that is causing the REST API request to fail.
Cause
In this scenario, there was a workflow property at the initial status that was causing the issue.
Workflow property:
jira.permission.createclone.denied = true
The same issue was also reported as a bug previously but it was not taken up for the fix. Refer JRASERVER-67652: Using jira.permission.createclone.denied on Initial Workflow Status breaks Issue Creation via REST API.
Solution
To resolve the problem, any of the below two ways can be used:
- Either remove the workflow property: jira.permission.createclone.denied from the project workflow and save and publish the workflow again.
- Or use the workaround mentioned in the above bug.
a) Grant the REST API user (e.g. admin) the permission to clone issues in the initial workflow status, by adding this property (keeping the others so that no one else can clone issues):Key: jira.permission.createclone.user Value: admin
Then use admin for the REST API call to create issues.
b) The permission can also be granted to a specific group:
Key: jira.permission.createclone.group.1 Value: jira-administrators