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

Tim McGee April 9, 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
Atlassian Team members are employees working across the company in a wide variety of roles.
April 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
AUG Leaders

Atlassian Community Events