Here a trick to list your Tempo Teams of your Jira Server in a Confluence Server page using the public Tempo API.
It’s very easy to do, but only possible in Server version of Confluence.
Just insert in the page a HTML Macro and fill with this Javascript/jQuery/Ajax/HTML code, That’s all!
Here the code:
<div id="teamsIDX"> <h1>Team List</h1> </div> <script> (function() { function getTempoTeams() { var user; // Documentation: https://tempoplugin.jira.com/wiki/spaces/JTMT/pages/78381258/Teams+REST+API+Guide#TeamsRESTAPIGuide-getAllTeams AJS.$.ajax({ url: "/rest/tempo-teams/1/team", type: 'get', dataType: 'json', async: false, success: function(data) { groups = data; } }); return groups; } function getTempoMembers( team_id) { var user; // Documentation: https://tempoplugin.jira.com/wiki/spaces/JTMT/pages/78381258/Teams+REST+API+Guide#TeamsRESTAPIGuide-getTeamMembersUsers AJS.$.ajax({ url: "/rest/tempo-teams/2/team/"+ team_id +"/member", type: 'get', dataType: 'json', async: false, success: function(data) { members= data; } }); return members; } var groups = getTempoTeams(); i = 0; //while ( i < groups.length) { while ( i < 3) { $('#teamsIDX').html($('#teamsIDX').html() + " <b>" + groups[i].name + "</b>"); var members = getTempoMembers(groups[i].id); j = 0; while ( j < members.length) { $('#teamsIDX').html($('#teamsIDX').html() + " " + members[j].member.name + ""); j++; } i++; } })(); </script>
This is exactly what I’m looking for. However, when I copy/paste this into my HTML Macro in Confluence (I am running Confluence Server Unlimited), and I update the route to include my JIRA URL, I just get the header. Any help would be greatly appreciated!
LikeLike
Hello Shawna,
If your Jira is in jira.xxx.com and your confluence in jira.xxx.com/wiki will work. (tested today in Jira 8.6 with latest Tempo plugin)
Your installation is different?
Regards
LikeLike
Good evening,
I am trying to do it in Jira and Confluence Server and I have read on the top that it just works in Jira Cloud. Do you know if this happens like this currently?
Thanks a lot
LikeLike