Unable to retrieve and update the attachment information in Python-jira rest api

I tried to upload an attachment using add_attachment() python rest api, but getting error.

I am able to upload the same attachment from GUI but unable to retrieve the info using the issue.fields.attachment JIRA rest api.

Please suggest me the resolution for this.

Getting the below error while attaching the file:

=====================================

r.status_code, error, r.url, request=request, response=r, **kwargs)
jira.exceptions.JIRAError: JiraError HTTP 500
text: <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Oops - an error has occurred</title><script type="text/javascript">contextPath = "";</script><link type='text/css' rel='stylesheet' href='/static-assets/metal-all.css' media='all'><script src='/static-assets/metal-all.js'></script><!--[if lt IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie.css' media='all'><script src='/static-assets/metal-all-ie.js'></script><![endif]--><!--[if IE 9]><link type='text/css' rel='stylesheet' href='/static-assets/metal-all-ie9.css' media='all'><![endif]--><meta name="decorator" content="none" /></head><body class=" error-page error500"><script type="text/javascript">document.body.className += " js-enabled";</script><div id="page"><header id="header" role="banner"></header><!-- #header --><section id="content" role="main"><div class="aui-page-panel"><div class="aui-page-panel-inner"><section class="aui-page-panel-content lowerContent"><div id="error-state"><span class="error-type"></span><h1>Sorry, we had some technical problems during your last operation.</h1><h2 class="technical-details-header"><span>Request assistance</span></h2><div id="technical-details-content" class="technical-details js-hidden"><p>Copy the content below and send it to your JIRA Administrator</p><div class="technical-details-content" contentEditable readonly><h2>Technical details</h2><p class="referral">Log&#39;s referral number: <strong>5bad8a91-8e65-4c68-a2e2-d6fcacab7748</strong></p><div class="info-section" id="causePanel"><h2>Cause</h2><p>Referer URL: <b>Unknown</b></p><pre></pre><p>Internal Server Error</p></div></div></div><p>Return to the <a href="javascript:window.history.back()">previous page</a></p></div></section><!-- .aui-page-panel-content --></div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></section><!-- #content --><footer id="footer" role="contentinfo"><section class="footer-body">

====================================================================

 

Retrieval of attachment information  throwing below error

=============================================

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

1 answer

0 votes

It looks like you have hit the wrong URL with your REST call.  You shouldn't have had any of that html back, it implies you're landing on standard pages rather than the REST one.

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Dec 06, 2018 in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

5,514 views 21 17
View question

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you