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

Create html tabel from JSON jira rest api on confluence page Edited

<table  class="confluenceTable", id="projectListTable">
    <th class="confluenceTh" >Key</th>
    <th class="confluenceTh" >Name</th>
    <th class="confluenceTh" >Lead</th>
    url: confluence/plugins/servlet/applinks/proxy?appId=ID&path=jira/rest/api/2/project?expand=lead',
    type: "get",
    dataType: "json",
    success: function(project) {

function drawTable(project) {
    for (var i = 0; i < project.length; i++) {
function drawProjectRow(rowProject) {

    var row = $("<tr/>")
    row.append($("<td class=\"confluenceTd\" >" + rowProject.key + "</td>"));
    row.append($("<td class=\"confluenceTd\" >" + + "</td>"));
row.append($("<td class=\"confluenceTd\" >" + rowProject.lead[0] + "</td>"));

Hi i'm trying to create dynamic table.
In column Lead getting "undefined"
And tell me how to make a link to the project from the key =)


1 answer

0 votes

Hi @Alex ,

I believe lead is not an array but it is JSON object with key, name and displayName fields. So you need to use not rowProject.lead[0] but e.g. rowProject.lead.displayName instead.

To make a link you just need to concatenate your base url with project key to get something like

<a href="http://localhost:8230/projects/rowProject.key"></a>

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Keep your team in the loop with Team @mentions in Jira Software!

Hi everyone! My name is Jenny, a Product Manager at Atlassian. After launching Team @mentions in Confluence, we heard a lot of positive feedback from customers that they love how easy it is to @men...

221 views 4 12
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