It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Python Script giving Attribute error when extracting issue information

Hi,

I'm basically extracting some fields from the issues in my project. So far I din't have any problem extracting the summary and description fields. But I'm unable to extract the fields from any other attribute. For example, I've used the following code, and I want to put the contents in the TechNowId field in the list. I've attached the code and the snap of the board as well as the console output :

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

for issue in issues_in_backlog:
description_list.append(issue.fields.description)
summary_list.append(issue.fields.summary)
tn_id_list.append(issue.fields.TechnowId)

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

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

for TechnowId in tn_id_list:
ws.cell(row = tn_id_row, column = start_column+2).value = TechnowId
tn_id_row += 1

 

Could someone help me with this????
Capture1.PNGCapture2.PNG

1 answer

1 accepted

1 vote
Answer accepted

@Pranay VermaAPI return value of custom field by custom-field id not by custom-field name.

Find ID of TechnoWorld field and use that. It will in format like 'customfield_xxxxx' where xxxx is number.

How can I find the id for that field?

You can do that by basically look at api response or on admin page of Jira.

This KB article describe this in detail - https://confluence.atlassian.com/jirakb/how-to-find-id-for-custom-field-s-744522503.html

Like Pranay Verma likes this

Hi @DPK J ,

I got the field name from the advanced search and used it as issue.fields.customfield_xxxxx, in the code, and it worked like a charm. Thanks a lot!!

Thanks And Regards,

Pranay

You are welcome @Pranay Verma 

Like Pranay Verma likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

838 views 5 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you