Downloading Attachments from JIRA API using VBA


We have a number of calls written in Excel/VBA that we use to pull data from JIRA using its APIs. One of those calls is to download attachments from a JIRA issue. Up until last week, everything was working fine and Atlassian are indicating they made a slight change to the storage of attachments which has coincided with the problem being seen. 

I can successfully download attachments from prior to last week. Attachments from last week to now, are returning a run-time error in the VBA code when doing the send. 

The code I have is:

With JiraService
.Open "GET", https://JIRACloudsite/secure/attachment/AttachmentID/FileName.pdf, False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Authorization", "Basic " & sEncbase64Auth
.SetRequestHeader "Accept", "application/json"

When doing the send, I am getting a "Run-time error -2147024891 (80070005) Access is denied". 

Has anyone else encountered this problem and any ideas of a solution?


3 answers

1 accepted

Please try the following:

  1. Declare JiraService as:
    Dim JiraService As MSXML2.ServerXMLHTTP60 
    rather than:
    Dim JiraService As MSXML2.XMLHTTP60

      2. Add the following lines of code to above procedure:

            With JiraService

            .setRequestHeader "Origin", "your JIRA URL"

            .setRequestHeader "X-Atlassian-Token", "nocheck"

(JIRA URL can be something like: "")


That did the trick. I cannot thank you enough.

Great, happy it solved the problem!

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,187 views 13 19
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot