I know you've answered this before but I have done it all.
I've set the right permissions in the project settings. To public as a matter of fact because nothing else worked for my app. Both for:
- Creating issues
- Managing reporters
I also had to manually find my userId so I could use it as a valid reporter id.
I have literally copied your example's code, and included the bare minimum JSON to create a Jira issue, all from your documentation:
```
Hi and welcome to the Atlassian community!
Try taking a step back, away from the code ... Use a tool like Postman to do the exact call as described and see if you can get that to work. This way you know your JSON, auth method (API token ...) is correct. From there you can move on and put it in your code.
This are probably the docs that you have used:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post
This works.
See how far you get with this!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the swift reply Jeroen.
Here's my output, same thing:
I'm using basic auth, putting my email as the username, and the access_token I received after going through the authentication flow I enabled using my Atlassian's OAuth 2.0 App.
Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your screenshot you are missing a closing "}" at the end.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I copy pasted my JSON into a linter and it said the JSON is valid.
I double checked and I have no missing "}". Unfortunately.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was mislead by the indentation, my bad.
I have done the exact same call (reporter my own id, own project):
The api seems to work perfectly, issues are created so something in the content makes the call fail in your case. One or some of the fields aren't on the create screen of the issuetype in that project, accept and content-type headers ...).
That's about the only thing I can think of because the call works here. Fact that it didn't work in the app, that could have several reasons. Call not working via Postman, then you will have to look at setup again. Try another (test) project?
Regards!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a brand new Company-managed project, and now I am setting the permissions.
I am using an access token that I got from oauth with the following scopes:
read:account read:me write:jira-work |
And I have also set the following permissions to public (because I'm not sure how to grant my oauth app these permissions):
These are the only two permissions I've set, and it's still throwing me the same error.
Could it be something in my screens?
I appreciate you taking the time to help me with this Jeroen.
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 Create screen for the project and issue type should contain all the fields you are trying to set in the call.
Furthermore, try creating an api token to use in you call:
https://id.atlassian.com/manage-profile/security/api-tokens
In Postman user basic auth with you emailadres and the token as password.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using the API token I generated worked, which is great but why didn't my oauth access token work?
My current app's flow is authenticating the user via oauth, and then trying to perform the operation (creating an issue) on the project they choose from a dropdown.
Does that mean that in order to enable at-scale usage of the Jira API for an org in our platform, we'll have to either:
1- Use one API key to handle all the operations for an org
2- Ask everyone to provide their ownAPI key
3- Can a managed account be used in this instance?
Trying to understand how I can enable this flow at scale, or at least what's industry standard.
What do you recommend?
Again, thank you for all the help Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, so that is cleared out.
The problem is then with you oAuth implementation in your app. Probably something wrong there, but since this now has become more of an implementation issue in an app instead of a configuration issue in the product, I think you will get a better answer concerning this and how to implement oAuth in your app in the Atlassian Develop Community:
https://community.developer.atlassian.com/
Good luck!
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.