Hi folks,
in my jira gadget I have several AJS.$.ajax() GET calls to get all meta information to create an Issue and finally an ajax POST("baseurl/rest/api/2/issue") call to create an Issue.
When I run my gadget at localhost with "atlas-run" everything works fine, but when I package it and deploy it on our production JIRA, I get an error response "400 Bad Request" with the JSON Response:
{"errorMessages":[],"errors":{"priority":"Field 'priority' cannot be set. It is not on the appropriate screen, or unknown.","labels":"Field 'labels' cannot be set. It is not on the appropriate screen, or unknown.","customfield_10072":"Field 'customfield_10072' cannot be set. It is not on the appropriate screen, or unknown."}}
I also checked my permissions, they are all fine. Running jira 5.2.11 - 6.0.7
I searched in several forums and found another dev who had the same problem, and he solved it by providing a BASIC Authentication with username and password in the POST call.
Two things about that:
Am I totally on the wrong way?
Any idea?
thanks in advance
Community moderators have prevented the ability to post new answers.
can you confirm all the fields i.e "Priority", "labels" and "customfield_10072
" are in edit screen and you have edit permission on that issue?
Aarrrghhh!! That was it!!(edit screen) what a shame... blackout!
Thank you so much! I had struggled 2 whole days with that..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to hear it worked!!!
Cheers!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yo Smruti,
I just used jquery ajax for the rest calls.
something like:
jquery.ajax({ type: "POST", url: "your-jira-host/rest/api/2/issue", data: /* see create issue rest api reference for request data */ }) .done(function( responsedata) { alert( "Data Retrieved: " + responsedata); });
before that POST call you need another rest GET call to get the metadata for creating issues
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arthur,
I'm trying to create issues by making rest calls in a gadget. I'm returning html cpntent from my resource to display the gadget. To build html content I'm using vm files.
Can you please give me an example of how you made the rest call from your gadget.
Thanks,
Smruti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
solved... I was dumb and blind, I forgot to get a list of available fields for creating issue, I thought a list of ALL FIELDS would do it. It's in the issue/createmeta under issuetypes....
(copied from doc)
"issuetypes": [ { "self": "http://www.example.com/jira/rest/api/2/issueType/1", "id": "1", "description": "An error in the code", "iconUrl": "http://www.example.com/jira/images/icons/issuetypes/bug.png", "name": "Bug", "subtask": false, "fields": { "issuetype": { "required": true, "name": "Issue Type", "operations": [ "set" ] } } } ]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.