Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

createmeta endpoint 'issue/createmeta/{project_id}/issuetypes/{issue_type_id} returns empty values

Tim McGee I'm New Here Apr 09, 2021

the existing creaemeta request '/rest/api/2/issue/createmeta'  was deprecated in Jira 8.4 and created a new method for finding issuetypes (specifically custom fields) with the following endpoint

issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}

The original request in earlier versions than 8.4 returned a list of custom fields, but having updated to 9.0 and using the new url I only get back 

{"maxResults":50,"startAt":0,"total":0,"isLast":true,"values":[]}

The code I'm using (simplified for this example) is this

url = f"{self.base_url}/rest/api/2/issue/createmeta/{'%s' % x.item_id}/issuetypes"
resp = self.make_api_call(url)

for issue_type in resp.json().get('values', []):
    url = f"{self.base_url}/rest/api/2/issue/createmeta/{'%s' % x.item_id}/issuetypes/{issue_type['id']}"
    resp = self.make_api_call(url)
    print(resp.json().get('values', [])

1 answer

0 votes
Andy Heinzer Atlassian Team Apr 12, 2021

Hi Tim,

I understand that you're using some version of Jira Server (or Data Center), and are trying to get back the createmeta data for some specific issuetypes in a project, but in the process of doing so are not getting back any results.  Not sure which version you are using, 9.0 has not been released yet, and 8.16.0 is the most recent version of Jira Server right now.

The endpoint you are calling of GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId} looks to be the correct one to me.  I tried to test this out in my own Jira 8.16.0, and I was able to get back expected results repeatedly when passing in valid project key and issuetype ids.  I tried to pass invalid ones, but the response I got was a bad request.

However I did find that if I made an unauthenticated REST API call to that endpoint, I got back the exact same response you see here of

{"maxResults":50,"startAt":0,"total":0,"isLast":true,"values":[]}%

Which leads me to believe that the problem here is more likely to be in regards to the way you are authenticating this REST call.  I would want to check the authentication of this request. Are you using basic auth, or a personal access token, or OAuth for the authentication here?  It could be that the account making this request might not have the permissions to create issues in this project, in which case that endpoint might not return the expected results for that account.

Interested to see if we can learn more here.

Let me know.

Andy

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you