Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Parse JSON objects on Confluence page?

I need to show data from JIRA custom field (Table Grid NG, which is available as JSON obj) on the Confluence page.

What is the best way to do that? I tried to look for a plugin that works with JSON objects but couldn't find anything suitable. 

1 answer

1 vote
Dominic Lagger Community Leader Jul 22, 2021

Hi @Viktor Kuzmychov 

There are a lot of apps which can handle JSON. (marketplace JSON)

But I think you want to get the data by REST, and you do not want to copy paste the JSON. 

So I would suggest you to use PocketQuery. We use this to get data from other systems, like Jira. I'm not sure, if the app can display the JSON obejct correctly... 

@Sven Schatter _Lively Apps_ : Can PocketQuery handle a JSON Object in the REST answer and display it correctly? 

 

Regards, Dominic

Thanks for tagging me @Dominic Lagger! :)

Yes, this is one of the primary uses cases of PocketQuery. In the Cloud version, PocketQuery has a mechanism that automatically makes it possible to display JSON objects, no matter what they look like, as a table.

On Server, you might need to write a Converter (which is a simple JavaScript function) to format your data into table.

E.g. if your result looks like this:

{
"project": "ABC",
"count": 235,
"issues": [
{"key": "ABC-1", "summary": "foo", ...},
{"key": "ABC-2", "summary": "bar", ...},
...
]
}

You will need to have Converter function like this:

function convert(json) {
return JSON.parse(json).issues;
}

So that PocketQuery receives the following data and can render it correctly as a table:

[
{"key": "ABC-1", "summary": "foo", ...},
{"key": "ABC-2", "summary": "bar", ...},
...
]

This might look a bit complicated at first, but is actually very simple once you understand how it works. If you decide to go with PocketQuery and have any questions or need help with your Converter, don't hesitate to raise a ticket with us. :)

Cheers,
Sven

Like Dominic Lagger likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

🏑 Atlympic Event: Confluence

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

525 views 18 17
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you