Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to get the list of values for custom field present in JIRA

Rahul K R
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 31, 2025

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.

1 answer

0 votes
Mercy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 11, 2025

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events