Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get proper xml data from the link

Minkyu Kim August 4, 2024

Hello.

I'm currently making a program using vba to convert jira's xml data to excel spreadsheet.

While i'm doing this, i want to use the url of xml data, not downloading the xml data locally. But if i do this, i couldn't get the proper xml data. 

The data that i recieved from the link doesn't have <item> tags, which contain the major information of the issues.

I really wanna know why it happens. How can i get the whole data from the link?

Thank you in advance.

 

1 answer

0 votes
Trudy Claspill
Community Champion
August 4, 2024

Hello @Minkyu Kim 

Welcome to the Atlassian community.

Are you working with Jira Data Center or Jira Cloud?

What URL are you using to get the xml data?

What documentation are you referencing as a guide?

Minkyu Kim August 4, 2024

Hello!

Guess that my reply has been deleted. If not, just ignore this.

 

I'm working with Jira Data Center I guess.

And I'm gonna use xml data generated when we click the export button.

The exact URL will be like this :

https://jira.global.companyname.com/si/jira.issueviews:issue-xml/~/~.xml

And I searched a lot of documents and after that I made a code using Server.XMLHTTP.6.0

This is the sample code that I used when importing the data from URL :

 

encoded = Base64Encode(":" & token)

Set xmlHttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
xmlHttp.Open "GET", xmlUrl, False

xmlHttp.setRequestHeader "Authorization", "Basic" & encoded
xmlHttp.setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.59"
xmlHttp.setRequestHeader "Accept", "text/xml"
xmlHttp.setRequestHeader "Content-Type", "text/xml"

xmlHttp.send

Set xmlDoc = CreateObject("MSXML2.DOMDocument")
xmlDoc.LoadXML xmlHttp.responseXML.XML

represent = xmlHttp.responseText
Debug.Print represent

 

Well I didn't attach the code above about the personal information but I've got API token so I guess I could reach to the data through URL.

If I run this code, the result only contains <channel> tag. But the original data contains a lot of <item> tags inside of the channel tag. I tried hard to figure it out but I haven't solved this problem.

Is there any problem? 

Thank You.

 

Trudy Claspill
Community Champion
August 6, 2024

I'm afraid your question is outside my realm of experience and knowledge. 

Suggest an answer

Log in or Sign up to answer