{"errorMessages":[],"errors":{"summary":"Field 'summary' cannot be set. It is not on the appropriate

Simon Jespersen February 15, 2021

After my organisation moved jira to cloud i cannot create stories through REST API 

I am running curl command 

curl -v \
-X POST \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"project":
{
"key": "DWH"
},
"summary": "REST ye merry simon.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Story"
}
}
}' \
-x httpproxy.myorgproxy.com:8080 --proxy-user my@user:mypasswd\
-L https://jira.myprg.eficode.io/rest/api/2/issue/ \

I get following error message running curl command 

{"errorMessages":[],"errors":{"summary":"Field 'summary' cannot be set. It is not on the appropriate screen

I tried to analyze what happens when i create a issue through UI google chrome browser and noticed that it requested following url 

Request URL: https://jira.myorg.eficode.io/rest/quickedit/1.0/userpreferences/create

 

What could be the reason for this error. 

1 answer

0 votes
Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 15, 2021

Hi @Simon Jespersen ,

When you create an issue through the UI of the issue type Story, does the field "summary" actually appear on the screen?

That is what the error describes, for the issue type Story in project DWH you are trying to set the field "summary" but it appears it is not on the create screen.

Simon Jespersen February 15, 2021

Hi Dirk, Thanks for reply 

it seens to me thcreatestory.jpg

Simon Jespersen February 15, 2021

Hi Dirk, it seems to me that the summary and description field are there and are mandatory for creating a issue of type Story 

I have tried with Uppercase first letter in summary but i still get the same error. 

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 15, 2021

I wonder if the call is just failing cause of some bad information.

Could you change the project part to use the id instead of the key.

"project": {
        "id": "10000"
         },

 

Where you change the id of course to the id of your project. Easiest way to get that is to open the project settings on your browser and check the url for the id.

i'm starting to think the key is not right as I can only find examples (in the documentation) with the project id.

https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-post

Simon Jespersen February 15, 2021

Hi Dirk, my projects key is DWH 

this is a copy paste from the URL 

?rapidView=226&projectKey=DWH&view 

do you think it could be some permissions issues ? 

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 15, 2021

If you are concerned about permissions you could look at the Permission Helper. That will tell you if something is missing/wrong.

https://support.atlassian.com/jira-cloud-administration/docs/use-the-jira-admin-helper/

Since you said you can create an issue manually (and I hope you tried with the same user) that would be weird tho.

 

For the project id could you go to your project settings and copy it from the url.

image.png

the number behind "pid=", and ofcourse change the json to use id  instead of key. (I just wanna make sure)

Simon Jespersen February 16, 2021

id managed to located the  by hover over the edit link in projekt administration PID 11202

i replaced it in the json 

curl -X POST \
-H 'Content-Type: application/json' \
--data '{
"fields": {
"project":
{
"key": "11202"
},
"summary": "REST ye merry simon.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Story"
}
}
}'

 

Now the error is 

{"errorMessages":[],"errors":{"project":"project is required"}}
Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2021

This 

"key": "11202"

should be

"id": "11202"
Simon Jespersen February 16, 2021

Tried that, it results in the same error i had to start with

 {"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."}

 This is very strange- 

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2021

Well at least we now know that the project is found with key or id so that's something.

Did you try the permission helper that I mentioned with the user that you are using in your api call?

https://support.atlassian.com/jira-cloud-administration/docs/use-the-jira-admin-helper/

The main thing would be to check if the user has the "Create Issues" permission and the "Browse Project" permission. The permission helper will then tell you if something is missing.

Simon Jespersen February 16, 2021

i will try to get our jira Administrator to look into this, i  and have no rights on the jira administrator. 

Like Dirk Ronsmans likes this

Suggest an answer

Log in or Sign up to answer