attachment.get() #1142
acckiydarik
started this conversation in
General
Replies: 1 comment
-
The example shows how you can iterate through available attachments, so if you know the name of the attachment you want, you can check that before printing. For example ATTACHMENT_NAME = "expected_file.txt"
for attachment in issue.fields.attachment:
if attachment.filename != ATTACHMENT_NAME:
continue # continue for loop if the filename does not match
print("Name: '{filename}', size: {size}".format(
filename=attachment.filename, size=attachment.size))
# to read content use `get` method:
print("Content: '{}'".format(attachment.get())) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I couldn't find an option to print content of only one particular file by name or id from attachments.
Is it possible?
https://jira.readthedocs.io/en/master/examples.html#attachments
thank you.
Beta Was this translation helpful? Give feedback.
All reactions