Am trying to list the values for custom field . I have access to view/select the list of values of that custom field.
And I give this URL -
# This code sample uses the 'requests' library: # http://docs.python-requests.org import requests import json url = "https://mags.arisglobal.com/rest/api/3/field/customfield_10403/context/32098/option" # url = "https://mags.arisglobal.com/rest/api/3/customFieldOption/32098" auth_token = "xxx" headers = { "Authorization": f"Bearer {auth_token}", "Accept": "application/json" } response = requests.get( url, headers=headers ) def get_pretty_print(json_object): return json.dumps(json_object, sort_keys=True, indent=4, separators=(',', ': ')) if response.status_code == 200: print(get_pretty_print(response.text)) # print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
It gave status code as 200 but returning html of logging page.
A 200 response that returns the login page HTML means Jira Cloud didn’t recognize your authentication header. The REST API you’re calling—`/rest/api/3/field/{fieldId}/context/{contextId}/option`—requires an API token with basic auth, not a bearer token. Replace your header with basic authentication using your Atlassian email and API token, for example:
```python
from requests.auth import HTTPBasicAuth
auth = HTTPBasicAuth("your_email@domain.com", "your_api_token")
headers = {"Accept": "application/json"}
response = requests.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.