Extract the labels' string to excel vba

Hello, anyone know how extract the labels' text to excel vba? 

wanna list out all the tags into excel sheet according to the issues.

1 answer

0 vote
Warren Levy Community Champion Sep 04, 2017

Hi

I need a bit more info for this. Do you already have a way of extracting info from Jira via the REST API, but want to know about labels? Or have you never extracted any info from Jira? Based on your answer, I (or anyone else) should be able to better help you

image.png

 

I have my own way to extract info from jira, just duno how to get the label query.

 

For a = 1 To json("total")

If IsNull(json("issues")(a)("fields")("labels")) Then
ActiveSheet.Cells(a, 3) = ""
Else
ActiveSheet.Cells(a, 3) = json("issues")(a)("fields")("labels")
End If


Next a

However, i get  this error once i run this coding.

image.png

Warren Levy Community Champion Sep 04, 2017

Try json("issues")(a)("fields")("labels")("value")

Warren Levy Community Champion Sep 04, 2017

You also need to loop around the labels - as you've shown in your screenshot, you have 2 labels, so I usually use a For Each loop on the labels

image.png

 

Error still occur. Anything to do with the query we GET ?  

image.png

image.png

 

This is the JSON string that i want to extract to excel macro.

Warren Levy Community Champion Sep 04, 2017

I think it should just be expand=changelog, not expand=changelog.histories, but if the JSON above is being returned, then that isn't the problem.

Have you made a change to the VBA code (from what you've shown above) where it is trying to get the labels from the JSON? If so, please include here, otherwise you need to change it to cater for multiple labels

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

27 views 0 4
Read article

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