I am requesting - https://api.atlassian.net/rest/api/3/issue/CNP-6274 (GET) - in Postman with:
I am logged into Jira using SSO - the above email - and I have created an API token in my account - I still get a 404 NOT FOUND - and I can see it in the web interface:
What am I missing?
Hello @Peter Harding
Welcome to the Atlassian community.
Is the base URL you are using in Postman a match for the base URL of your Jira cloud instance? In postman you have https://api.atlassian.net . Is that the same base URL you see when you are looking at the issue through the Jira UI?
I have also tried
* jira.atlassian.net; and
* latitudefs.atlassian.net (which is the baseUrl used in our browser based Jira)
With jira.atlassian.net I get:
Found this - https://docs.atlassian.com/software/jira/docs/api/REST/1000.1041.0/ - but it does not seem to cover the use of tokens.
I haven't sorted out the Postman issue but did get it working with Python.
This worked:
#!/usr/bin/env python### -----------------------------------------------------------------------------""" See https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-search/#api-rest-api-2-search-get"""# ----------------------------------------------------------------------------- import osimport jsonimport requestsfrom dotenv import load_dotenvfrom requests.auth import HTTPBasicAuthload_dotenv()ORG = os.getenv("ORG_PREFIX", None)TOKEN = os.getenv("JIRA_API_TOKEN", None)EMAIL = os.getenv("EMAIL", None)if ORG == None: raise("No organisation provided")if TOKEN == None: raise("No token provided")if EMAIL == None: raise("No email address provided")ISSUE = "CNP-6001"URL = f"https://{ORG}.atlassian.net/rest/api/2/search"auth = HTTPBasicAuth(EMAIL, TOKEN)HEADERS = { "Accept": "application/json"}query = { "jql": f"issue = {ISSUE}"}response = requests.request( "GET", URL, headers=HEADERS, params=query, auth=auth)print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
.env file contains the sensitive info
ORG_PREFIX=some-orgJIRA_API_TOKEN=xxxxEMAIL=someone@example.com
It looks like you're new here. Sign in or register to get started.