The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Parse JSON objects on Confluence page?

Viktor Kuzmychov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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_
Atlassian Partner
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
TAGS
AUG Leaders

Atlassian Community Events