Forums

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

Jira Rest API retrieving custom field 'jira.resources.PropertyHolder object'

Erin Kinsey
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!
October 22, 2023

When trying to fetch custom fields via the rest API I keep receiving [<jira.resources.PropertyHolder object at .........>] and I cannot access the values in this field. What do I do?

 

import pandas as pd
from jira import JIRA
import requests

# Disable SSL certificate verification
requests.packages.urllib3.disable_warnings()

# Jira credentials
username = " "
api_token = " "
jira_url = " "
# Project key
project_key = " "

# Connect to Jira
jira = JIRA(server=jira_url, basic_auth=(username, api_token), options={'verify': False})


# Construct JQL query
jql_query = f"project = '{project_key}'"


field_names = list(field_names)
# Iterate over each issue and extract field values
for issue in issues:
issue_data = {}
for field in field_names:
if hasattr(issue.fields, field):
# Standard fields
value = getattr(issue.fields, field)
elif field == "Issue key":
value = issue.key
elif field.startswith("customfield_") and field in issue.raw["fields"]:
value = issue.raw["fields"][field]
else:
if isinstance(value, dict):
value = extract_value(value)
value = value.value
issue_data[field] = value if value is not None else ''
#Convert complex objects to their string representation
if field == "complex_field":
if hasattr(value, "custom_attribute"):
value = value.custom_attribute
issue_data[field] = value
data.append(issue_data)
print(f"Issue Key: {issue.key}")

 

# Create a DataFrame from the extracted data
df = pd.DataFrame(data)

1 answer

0 votes
Mohamed Benziane
Community Champion
October 23, 2023

Hi,

Can you show us your script ? Do you use a module like Jira Python ?

Erin Kinsey
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!
October 23, 2023

I included a snippet of what I receive below and a snippet of my code aboveScreenshot 2023-10-23 084304.png above 

Like Kenta Yoshizawa likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events