Create issue via API v2 fails with error message "Field Access Category is required"

G.M. December 16, 2019

Hi,

I am trying to use the REST API v2 to create a Jira issue.

I use POST with the following request body:

{
"fields": {
"project": {
"key": "my project"
},
"summary": "my summary",
"description": "my description",
"issuetype": {
"name": "my issue type"
}
},
"properties": [
{
"key": "prop1",
"value": "value1"
}
]
}

This is the response that I get:

{
"errorMessages": [
"Field Access Category is required."
],
"errors": {}

Project and issue type are very likely correct: If I change them to a invalid value I get a different error message. 

What does this error mean? I guess I need to configure my Jira instance differently, but how? 

2 answers

1 accepted

0 votes
Answer accepted
G.M. December 16, 2019

Hi,

Thx for the quick reply. 

I queried all fields for my issue type with the Meta Api:  

GET /api/2/issue/createmeta?projectKeys=myProject&issuetypeNames=myIssueType&expand=projects.issuetypes.fields

 The result only contains the fields "summary", "issuetype", "description", and "project". Unfortunately no "Field Access Category" here.

I am still not sure what "Field Access Category" is at all. Is this a pre-defined field or a some custom field of my organization?

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 16, 2019

I think it's a Custom Field.

Have you tried API v3, it seems to be more stable.

G.M. December 16, 2019

I tried API v3. Here I get a different error:

{
"errorMessages": [],
"errors": {
"description": "Operation value must be an Atlassian Document (see the Atlassian Document Format)"
}
}

I also do not know how to get rid of this error ;) 

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 16, 2019

You need to send description not as plain text but as ADF - https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/,

You use this CURL sample,

curl --request POST \
--url '/rest/api/3/issue' \
--user '<email>:<api_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"issuetype": {
"id": "10000"
},
"project": {
"id": "10000"
},
"summary": "Sample summary",
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Sample description",
"type": "text"
}
]
}
]
}
}
}'
G.M. December 16, 2019

With the correct ADF format I now get the "Field Access Category is required" error for API v3 as well ;)

Looks like a really need to find out what this field is and how to set it or change it to not being required.

Thx a lot for your answers. 

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 18, 2019

@G.M.Can you mark answer at the bottom also as accepted and up-vote?

Thanks!!!

0 votes
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 16, 2019

@G.M.  Welcome to the community!!

Error here is straight forward, you need to specify some value for Field Access Category.


Please check if this field is marked required in your field configuration, if yes check valid values and pass it in api.

You can validate and get list of all required field using Issue Meta Api - https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-createmeta-get

Suggest an answer

Log in or Sign up to answer