Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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

Edited
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!
Oct 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 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!
Oct 23, 2023

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

Suggest an answer

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

Atlassian Community Events