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

Issue with API for creating issues

John Law
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 23, 2021
Hey, 
I was hoping someone could shed some light on an issue I am having please.
I have an alert in Splunk to create a Jira issue, but it does not appear to work. The Jira replay search gives me the json content as the below, but it does not give me any errors.:
{
"fields": {
"project": {
"key": "SOCALERT"
},
"summary": "Splunk Alert - Multiple failed login attempts - The user ****.",
"description": "The alert condition for 'A028 - Multiple failed login attempts' was triggered.",
"issuetype": {
"name": "Azure Alerts"
}
}
}
So, I created a postman call to parse the above content and it does shed some light with the following response.
{
"errorMessages": [],
"errors": {
"summary": "Field 'summary' cannot be set. It is not on the appropriate screen, or unknown.",
"description": "Field 'description' cannot be set. It is not on the appropriate screen, or unknown."
}
}
I have confirmed that the create screen does indeed contain these fields, as you would expect they are the basic fields, but I still get the error. I appreciate formatting has been lost here, so attached is a screenshot.
Please, does anyone have any ideas? I am pretty certain I ran something similar a few weeks back and it worked fine.
Screenshot 2021-09-23 at 20.48.04.png

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Support Team [Clearvision]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2021

Hi John,

The data format for description needs to be in the Atlassian document format if using the rest API in cloud. You can see an example on the following page:

https://blog.developer.atlassian.com/creating-a-jira-cloud-issue-in-a-single-rest-call/

Try using that format in postman. Trying the format you are using in cloud gives the following error on my test

"Operation value must be an Atlassian Document (see the Atlassian Document Format)"

Support Team [Clearvision]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2021

Also are you trying this on a company managed project (classic) or a team managed project (Next-gen) ? and what API endpoint are you using /rest/api/2 or /rest/api/3

3 is in beta and supports the Atlassian document format. 2 would accept the format you have

John Law
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 24, 2021

Thanks, I think it is classic, I tried with the Atlassian document format and I still get the same issue on api/3.

 

{

    "fields": {

        "summary": "JL - Test",

        "issuetype": {

            "id": "10052"

        },

        "project": {

            "key": "SOCALERT"

        },

        "description": {

            "type": "doc",

            "version": 1,

            "content": [

                {

                "type": "paragraph",

                "content": [

                    {

                    "text": "This is the description.",

                    "type": "text"

                    }

                ]

                }

            ]

        }

    }

}

 

I have changed from api/3 to api/2 and changed auth from API to basic and now it is working as expected. I guess I had something wrong somewhere.

Gomez de la Vega, Hernando July 24, 2024

This was very useful. Did the trick for me... In case it helps anybody else:


  1. We had an on prem instance
  2. We migrated to Jira cloud
  3. The prior API used the following authorization
    1. Basic uid:password (Base64 encoded)
  4. The new API in Jira lcoud required the following changes:
    1. Basic email:API-Token (Base64 encoded)
    2. The description structure updated to the Atlassian Document format which is in the URL shared above (https://blog.developer.atlassian.com/creating-a-jira-cloud-issue-in-a-single-rest-call/)
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events