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

Parse JSON objects on Confluence page?

Viktor Kuzmychov July 22, 2021

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 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

Sven Schatter _Lively Apps_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 23, 2021

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
AUG Leaders

Atlassian Community Events