Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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?

DPK J Community Leader Dec 16, 2019

I think it's a Custom Field.

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

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 ;) 

DPK J Community Leader Dec 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"
}
]
}
]
}
}
}'

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. 

DPK J Community Leader Dec 18, 2019

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

Thanks!!!

0 votes
DPK J Community Leader Dec 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
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you