Hi,
I am trying to get project details (issue types, fields) while creating an issue from my application.
When I try https://domain.atlassian.net/rest/api/2/issue/createmeta?projectKeys=SSPM, the request return an empty response.
But when I make the "K" letter in the projectKeys to small letter "k" it is showing all the project details. (https://domain.atlassian.net/rest/api/2/issue/createmeta?projectkeys=SSPM).
Anyone know what the exact issue?
As per developer documentation, we need to use capital "K".
PS: Even when I use projectIds facing the same problem.
Hi @Kannan Krish ,
I am not able to reproduce the reported behavior.
Actually, on my side, everything works fine whether I use projectKeys while when I use projectkeys it looks like the key is not recognized and all the projects are returned.
This behavior is consistent using the version 2 or version 3 of the Jira Cloud REST API and I can reproduce it in my Browser (chrome) as well as using Curl:
// https://XXXXX.atlassian.net/rest/api/3/issue/createmeta?projectKeys=TRP
{
"expand": "projects",
"projects": [
{
"self": "https://XXXXXXXX.atlassian.net/rest/api/3/project/10200",
"id": "10200",
"key": "TRP",
"name": "Test Rest Project",
"avatarUrls": {....
projectkeys (wrong behavior, all the projects are returned):
// https://XXXXXX.atlassian.net/rest/api/3/issue/createmeta?projectkeys=TRP
{
"expand": "projects",
"projects": [
{
"self": "https://XXXXXXX.atlassian.net/rest/api/3/project/10301",
"id": "10301",
"key": "CUL",
"name": "CUL",
"avatarUrls": {...
Can you kindly let us know how are you calling these REST API endpoints in order to face the reported behavior (please provide as many details as possible)?
Cheers,
Dario
Hi @Dario B
Thank you for your reply.
Yes when I use projectkeys, it is returning all the projects. (sorry I didn't notice it while testing)
When I try to get project details while creating an issue, the below API call returning an empty response -
https://domain.atlassian.net/rest/api/2/issue/createmeta?projectKeys=SSPM,
{
"expand": "projects",
"projects": []
}
But I when I try https://domain.atlassian.net/rest/api/2/project/SSPM it is returning the correct project details.
{
"expand": "description,lead,issueTypes,url,projectKeys,permissions",
"self": "https://domain.atlassian.net/rest/api/2/project/11320",
"id": "11320",
"key": "SSPM",
"description": ""...
Is this something permission related issue? Because I can create issue from Jira UI but getting an empty response in API call.
If this is a permission related issue what permission do I need to get data when I make an API call?
PS: I tried to see the permission that I have in this project using the following URL https://domain.atlassian.net/rest/api/2/project/SSPM?expand=permissions
"permissions": {
"canEdit": true
},
Thanks,
Kannan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kannan Krish ,
I am not sure what you are trying to achieve exactly, but the 2 different endpoints are meant for 2 different things and indeed require different permissions.
As witten in the Atlassian REST API V2 documentation page
Returns details of projects, issue types within projects, and, when requested, the create screen fields for each issue type for the user.....
....
This operation can be accessed anonymously.Permissions required: Create issues project permission in the requested projects.
App scope required:
READ
OAuth scopes required:read:jira-work
- /rest/api/2/project/{projectIdOrKey}
Returns the project details for a project.
This operation can be accessed anonymously.
Permissions required: Browse projects project permission for the project.
App scope required:
READ
OAuth scopes required:read:jira-work
Please review the documentation for both endpoints, make sure you have the proper permissions (create issue permission) and let me know if you are then able to get the correct data when calling the /rest/api/2/issue/createmeta endpoint.
Have a nice weekend,
Dario
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.