The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Error while retrieving custom fields in JIRA

Anto Praveen
January 19, 2019

 i am not able to fetch the data for custom filed using the below approach , can you please help

This is the error i am getting 

 description_list.append(issue.fields.customfield_15742)
AttributeError: type object 'PropertyHolder' has no attribute 'customfield_15742'

 and this is my code 

key_list = []
summary_list = []
description_list = []

issues_in_project = jira.search_issues('project=OUTAGE AND created >= -7d')

for issue in issues_in_project:
key_list.append(issue.key)
summary_list.append(issue.fields.summary)
description_list.append(issue.fields.customfield_15742)



wb = Workbook()
ws = wb.active
key_row = 1
summary_row = 1
description_row = 1

start_column = 1

for key in key_list:
ws.cell(row=key_row, column=start_column).value = key
key_row += 1

for summary in summary_list:
ws.cell(row=summary_row, column=start_column + 1).value = summary
summary_row += 1

for customfield_15742  in description_list:
ws.cell(row=description_row, column=start_column + 2).value =customfield_15742
description_row += 1


wb.save("jira-report.xlsx")




 

https://community.atlassian.com/t5/Jira-questions/Fetch-Jira-details-in-excel-using-python/qaq-p/763401


import
jira.client
from jira.client import JIRA
from openpyxl import Workbook

jira_options={'server': 'http://example.com'}
jira=JIRA(options=jira_options,basic_auth=('admin','password'))


key_list = []
summary_list = []

#Add additional lists for fields here
#Example:
#description_list = []



issues_in_project = jira.search_issues('project=ALPHA AND assignee= admin')

for issue in issues_in_project:
key_list.append(issue.key)
summary_list.append(issue.fields.summary)

# Add additional fields returned here
# Example:
#. description_list.append(issue.fields.description)


wb = Workbook()
ws = wb.active
key_row = 1
summary_row = 1
#add additional "$FIELD_row = 1" entries here so the field results start at row 1
#Example:
#description_row = 1


start_column = 1



for key in key_list:
ws.cell(row=key_row, column=start_column).value = key
key_row += 1

for summary in summary_list:
ws.cell(row=summary_row, column=start_column+1).value = summary
summary_row += 1

# add additional fields here
#Example:
#for description in description_list:
# ws.cell(row=description_row, column=start_column+2).value = description
# description_row += 1

wb.save("jira-report.xlsx")

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Anto Praveen
January 21, 2019

Have fixed it

SujanReddy Bonga
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!
May 6, 2021

How did you solve the issue

Aparna
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!
August 22, 2023

@Anto Praveen  How did you solve the issue: AttributeError: type object 'PropertyHolder' has no attribute 'customfield_15742'

TAGS
AUG Leaders

Atlassian Community Events