0

I've made a python script that creates Jira issues and attach a file to them.

This part works fine and I can see the attachment directly in Jira. I can also see the attachment in my Python script if I reference directly the attachment ID (that I've found in the Jira page of my issue) with that bit of code :

att = jira.attachment(116328)
print att

But if I open the issue in my Python script, I won't see any attachment attached to it :

issue = jira.issue('ARR-10')
print issue.fields.attachment

Will return : AttributeError: type object 'PropertyHolder' has no attribute 'attachment'

I was using the version 1.0.10 and upgraded to 2.0.0, but it didn't make a difference.

I'm sure that the issue I'm looking up has an attachment, I just can't understand why there are no attachment attributes. I've checked the "Questions that may already have your answer" but none of them are helping.

Thanks !

Guillaume
  • 1,811
  • 2
  • 16
  • 22

1 Answers1

1

The Jira REST API doesn't return fields that are hidden in the field configuration. Verify that the Attachments field is not hidden in the field configuration.

Source: Fetching an Issue Via API Does Not Return All fields

FLeX
  • 444
  • 4
  • 13