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?
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?
I think it's a Custom Field.
Have you tried API v3, it seems to be more stable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
}
]
}
]
}
}
}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.