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!

Captura de pantalla 2018-04-20 a las 19.37.33

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>
Posted by:.

4 replies on “How to list your Jira Tempo Teams and members in a Confluence page

  1. 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!

    Like

    1. 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

      Like

  2. 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

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s