projectKeys=SSPM vs projectkeys=SSPM

Kannan Krish June 26, 2019

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.

2 answers

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 27, 2019

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:

 

  • projectKeys (correct behavior, only TRP related info is returned):
// 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  

Kannan Krish June 27, 2019

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

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2019

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

 

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

Suggest an answer

Log in or Sign up to answer