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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
the number behind "pid=", and ofcourse change the json to use id instead of key. (I just wanna make sure)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This
"key": "11202"
should be
"id": "11202"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i will try to get our jira Administrator to look into this, i and have no rights on the jira administrator.
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.