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
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

303 views 1 3
Join discussion

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