Hello
Right now im trying to make an application for JIRA, im upgrading from using SOAP RPC to using the newest REST api, and all the GET methodes work perfectly.
Now im trying to make POST methodes works properly. But when im trying to create a new issue using: http://docs.atlassian.com/jira/REST/latest/#id161572 it all breaks.
Im getting this 400 Eror: {"errorMessages":[],"errors":{"summary":"Field 'summary' cannot be set. It is not on the appropriate screen, or unknown.","priority":"Field 'priority' 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."}}
It supposed to be a JSON format exception, but when i look at my JSON post form with data, it perfectly match the requriments at their API site. I even try to copy that data they use there, and still get the error.
So my question is, have you any idea what i do wrong?
The solution has been found :)
The HTTP Basic Session Cookie just need to be preemptive:
httpRequest.addHeader(new BasicScheme().authenticate(new UsernamePasswordCredentials("username","password"), httpRequest));
Jira says its a JSON format problem, but it is a auth-error. Hope it helps other people..
How to properly do it in PHP CURL? I tried to invoke curl_setopt(handle, CURLOPT_USERPWD, "user:password") again but still throws 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 have the same problem, but I use jquery ajax to call this rest functions. Any idea what I can do to solve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
According to this StackOverflow answer, this is the default setting for cURL authentication. It can be forced by including this line before the authentication line:
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
As such, it's unlikely that the problem is authentication in the PHP cURL context. Nevertheless, in order to test this, one suggestion would be to try using a different requests library, like HTTP_Request2 or GuzzleHTTP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same problem, but I use python to call this rest functions. Any idea what I can do to solve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having the same issue with python library
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The server returned the following errors:
Since Capure for jira
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.
The authentication can be the problem, but it can also be another problem: You should look which fields are visible when you press "create issue". When you try to create an issue with the REST API you may only set the fields that are visible in that screen.
I had the same problem, and solved it by adding the needed fields to the create issue screen: https://answers.atlassian.com/questions/207159/how-to-use-rest-api-to-create-issue-in-gadget
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When getting errors like;
"reporter": "Field 'reporter' cannot be set. It is not on the appropriate screen, or unknown."
"assignee": "Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown."
"summary": "Field 'summary' cannot be set. It is not on the appropriate screen, or unknown."
Solution: (you should create screen permission before creating issue with the code, only if you are creating it with the code)
Solution 1: 1st solution is the same as @Ravi Somisetty provided on this same page.
Solution 2: Here i will elaborate @Nic Brough [Adaptavist]'s answer.
Verify if the "reporter" or "assignee" or "summary", exists on the 'Create Issue'.
You may find the 'Create Issue' as;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yup, banged my head on this for a couple of hours.... the message is deceiving. It turned out that it was an authentication issue. In my case I was injected the Base64 encrypted key right into the header - overlooking it as I did not get an authentication error and used the same hash on my rest client plugin - no issues there... on a whim on decided to hash the auth piece in code then pass it in my request. Worked like a charm - Jira please provide a more friendly and intuitive error! Cheers
const auth = 'Basic ' + new Buffer('usr' + ':' + 'pass').toString('base64');
Authorization': auth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
got the same problem.
like steffenkarisson said, its an authentication problem. i solved this by authenticate the user before creating the issue.
DefaultHttpClient client = new DefaultHttpClient(); HttpGet getRequest = new HttpGet(url + "rest/auth/latest/session"); getRequest.addHeader("Authorization", "Basic " + userToken); getRequest.addHeader("accept", "application/json"); HttpResponse getResponse = client.execute(getRequest); HttpPost postRequest = new HttpPost(....); // start to send the issue ....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any sollution for this................
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We had similar errors,
errors":{"xyz":"Field 'xyz' cannot be set. It is not on the appropriate screen, or unknown."}}
The cause for us was definitely authorisation and not our json body or fields.
We were passing in an old token in the authorisation header of the API post, it wasn't until we base64 decoded it and compared that we realised the mistake.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the same issue. It ended up being a permissions issue (the error message is not helpful, I had to remove all the fields except for 'key' and 'issue type' to find this out). Make sure your users role/groups has permission. You can check in administration-->issue-->permission schemes. Check 'create issues' project permission, if not then add, and hopefully it works. Instructions here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I'm able to create issue in Postman, both using POST requests in either OAuth 1.0 and Basic authentication calls.
In Java Spring boot project, there is a mandatory to use OAuth 1.0, and although I use all get API call without any errors, I still don't know how to make a POST request for creating new issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same issue on Postman, my error was inheriting credentials from another request
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have encountered the same issue , it was authentication issue as suggested.
Just postman to see the Basic authentication and username and password
copied the "authorization" : "Basic ...."
to my code in header i.e i m using loopback connector to connect to create issue in jira.
"headers": { "accepts": "application/json", "content-type": "application/json", "authorization":"Basic wdsdssds=" },
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any updates on this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got the same error when creating an issue ticket by using REST API.
{"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."}}
Here is my cod. Do I missing anything or have wrong field name?
String jiraHost = "https://xxxx/rest/api/2/issue/";
<font></font>
String data =
<font></font>
"{\"fields\":"+
"{\"project\":{\"key\": \"BTBA\"}," +
"\"summary\":\"PMD - Asset folders.\"," +
"\"Description\": \"Creating of an issue using project keys and issue type names using the REST API\", " +
"\"issuetype\": {\"name\":\"Bug\"}}}"
;
<font></font>
HttpClient client =
<font></font>
new
DefaultHttpClient();
client = WebClientWrapper.getSSLClient(client);
<font></font>
HttpPost post =
<font></font>
new HttpPost(jiraHost);
<font></font>
StringEntity entity =
<font></font>
newStringEntity(data);<font></font>
entity.setContentType(
<font></font>
"application/json");
post.setEntity(entity);
HttpResponse response = client.execute(post);
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.
error message saying that summary,priority and description fields are not there on the screens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But the error seems to clearly state that the mandatory fields are missing in the request. Can you post the code fragment?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.