Page tree
Skip to end of metadata
Go to start of metadata

Tempo Teams REST API is for developers who want to integrate with Tempo add-ons. The REST API is a standard interface for interacting with the Tempo Teams module. Use the REST API browser built into JIRA to browse the services provided by the Teams REST API. The examples in this tutorial use curl and are meant to give an idea of how to use the REST API for common use cases.  

(info) Note this is not a complete list of available services.

For more detailed information on REST see JIRA REST APIs documentation.

AvailableTempo Teams 2.0.7 and later

Please note that member was memberBean and membership was membershipBean in version 2.0.6 and earlier

Data Types

The Teams REST resources have a few different types of parameters that are documented below. 

Team Link Scope Types

Parameter name: {scopeType}

Possible type values:

  • project - the link is of type JIRA project 
  • board - the link is of type JIRA Agile board

Team Member Types

Parameter name: {type}

Possible type values:

  • user - the member is of type JIRA user
  • group - the member is of type JIRA group

Team Permission Keys

Team permissions can be provided by different Tempo modules.  The list of available permission keys can grow with new releases.  

Parameter name: {permissionKey}

Possible key values: 

  • tempo.teams.browse.team - permission to Browse Team information
  • tempo.timesheets.approve.timesheet - permission to approve team member timesheets

Query Existing Team Data

Get all teams that the logged in user has permission to browse.

Request

curl -D -u fred:fred -X GET -H "Content-Type: application/json" http://localhost:8090/jira/rest/tempo-teams/1/team

Response

The response provides all teams that the user can browse and the basic information about each of them. 

  {
    "id": 3,
    "name": "Cloud Development",
    "summary": "Cloud Development Team",
    "lead": "erica"
  },
  {
    "id": 1,
    "name": "GreenCloud",
    "summary": "The Whole Company",
    "lead": "john"
  }


Get all basic information on a specific team using the teams id. The logged in user must have the Browse Team permission for that team. In this example we use the team id 3.

Request

curl -D- -u fred:fred -X GET -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/1/team/3

Response

The response provides all basic information for the specified team.

{
  "id": 3,
  "name": "Cloud Development",
  "summary": "Cloud Development Team",
  "lead": "erica"
}

Add New Team

Adding new team requires the Tempo Team Administrators permission (or the Tempo Team Manager permission for Tempo Teams 2.x.x or earlier).

Request

curl -D- -u fred:fred -X POST --data '{see below}' -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/1/team

Data

{
	"name": "GreenCloud",
	"summary": "The Whole Company",
	"lead": "john"
}

Response

The response provides new id for the added team and the data that was given above.

{
  "id": 8,
  "name": "GreenCloud",
  "summary": "The Whole Company",
  "lead": "john"
}

Query for Team Members

Team members can be both JIRA users and JIRA groups (see Data Types). In this endpoint the default value for the member type is user.

Get all group members in a team. In this example we use the team id 3. Requires the Browse Team permission.

Request

 curl -D- -u fred:fred -X GET -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/2/team/3/member?type=group

Response

The response provides all team members of the type group.

  {
    "id": 31,
    "member": {
      "teamMemberId": 31,
      "name": "cloud-dev-user",
      "type": "GROUP",
      "avatar": {},
      "activeInJira": true,
      "displayname": "cloud-dev-user"
    },
    "showDeactivate": false
  }


Get all users in a team.  In this example we use the team id 3. Requires Browse Team permisson. 

Request

 curl -D- -u fred:fred -X GET -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/2/team/3/member

Response

The response provides all team members of type user and also all users that are members of groups in the team.

   {
    "id": 4,
    "member": {
      "teamMemberId": 4,
      "name": "bob",
      "type": "USER",
      "avatar": {
        "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10138",
        "24x24": "/jira/secure/useravatar?size=small&avatarId=10138",
        "32x32": "/jira/secure/useravatar?size=medium&avatarId=10138",
        "48x48": "/jira/secure/useravatar?avatarId=10138"
      },
      "activeInJira": true,
      "displayname": "Bob Johnson"
    },
    "membership": {
      "id": 4,
      "role": {
        "id": 4,
        "name": "Developer"
      },
      "dateFrom": "",
      "dateTo": "29/Nov/13",
      "availability": "50",
      "teamMemberId": 4,
      "teamId": 3,
      "status": "active"
    },
    "showDeactivate": false
  },
  {
    "id": 5,
    "member": {
      "teamMemberId": 5,
      "name": "david",
      "type": "USER",
      "avatar": {
        "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10122",
        "24x24": "/jira/secure/useravatar?size=small&avatarId=10122",
        "32x32": "/jira/secure/useravatar?size=medium&avatarId=10122",
        "48x48": "/jira/secure/useravatar?avatarId=10122"
      },
      "activeInJira": true,
      "displayname": "David Carsen"
    },
    "membership": {
      "id": 5,
      "role": {
        "id": 1,
        "name": "Member"
      },
      "dateFrom": "01/Dec/13",
      "dateTo": "",
      "availability": "100",
      "teamMemberId": 5,
      "teamId": 3,
      "status": "active"
    },
    "showDeactivate": true
  }

Add Member to Team

Add a member to a team.  In this example we use the team id 3. Requires the Tempo Team Administrators permission (or the Tempo Team Manager permission for Tempo Teams 2.x.x or earlier).

Request

 curl -D- -u fred:fred -X POST --data {see below} -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/2/team/3/member

Data

             {
            "member": {
                "name": "erica",
                "type": "USER"
            },
            "membership": {
                "role": {
                    "id": 3
                },
                "dateFrom": "04/Jan/2013",
                "dateTo": "",
                "availability": "100",
                "teamId": 3
            }
        }

Response

The response provides the newly added member and membership. Requires the Tempo Team Administrators permission (or the Tempo Team Manager permission for Tempo Teams 2.x.x or earlier).

 {
  "id": 33,
  "member": {
    "teamMemberId": 33,
    "name": "erica",
    "type": "USER",
    "avatar": {
      "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10120",
      "24x24": "/jira/secure/useravatar?size=small&avatarId=10120",
      "32x32": "/jira/secure/useravatar?size=medium&avatarId=10120",
      "48x48": "/jira/secure/useravatar?avatarId=10120"
    },
    "activeInJira": true,
    "displayname": "Erica Jefferson"
  },
  "membership": {
    "id": 32,
    "role": {
      "id": 3,
      "name": "Scrum Master"
    },
    "dateFrom": "04/Jan/13",
    "dateTo": "",
    "availability": "100",
    "teamMemberId": 33,
    "teamId": 3,
    "status": "active"
  },
  "showDeactivate": true
}


Add a group to a team.  In this example we use the team id 3. Requires the Tempo Team Administrators permission (or the Tempo Team Manager permission for Tempo Teams 2.x.x or earlier).

Request

 curl -D- -u fred:fred -X POST --data {see below} -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/2/team/3/member

Data

 {
  "member" : {
    "name" : "jira-administrators",
    "type" : "GROUP"
  },
  "membership": {
        "role": {
        }
    }
}

Response

The response provides the newly added group.

 {
  "id": 32,
  "member": {
    "teamMemberId": 32,
    "name": "jira-administrators",
    "type": "GROUP",
    "avatar": {},
    "activeInJira": true,
    "displayname": "jira-administrators"
  },
  "showDeactivate": false
}

Deactivate Team Member

Deactivating a member means closing the current membership period.

In this example we use the team id 3 and member id 4. Requires the Tempo Team Administrators permission (or the Tempo Team Manager permission for Tempo Teams 2.x.x or earlier).

Request

 curl -D- -u fred:fred -X PUT -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/2/team/3/member/4/deactivate

Response

The response provides the membership of the deactivated member.

 {
	"id": 5,
	"role": {
		"id": 1,
		"name": "Member"
	},
	"dateFrom": "01/Dec/13",
	"dateTo": "20/Jan/14",
	"availability": "100",
	"teamMemberId": 5,
	"teamId": 3,
	"status": "past"
}

Remove Member from Team

Remove a member from a team, returns an empty response.  In this example we use the team id 3 and member id 4. Requires the Tempo Team Administrators permission (or the Tempo Team Manager permission for Tempo Teams 2.x.x or earlier).

Request

 curl -D- -u fred:fred -X DELETE -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/2/team/3/member/4

Update Team Permissions

JIRA users and groups can be granted different team permissions (see Data Types). 

Update the Approve Timesheet permission of a team.

All members who should have the permission must be specified. Members can be JIRA users or groups. In this example we use the team id 3. Requires the Tempo Team Administrators permission (or the Tempo Team Manager permission for Tempo Teams 2.x.x or earlier).

Request

 curl -D- -u fred:fred -X PUT --data {see below} -H "Content-Type: application/json"  http://localhost:8090/jira/rest/tempo-teams/2/permission/team/3/tempo.timesheets.approve.timesheet

Data

{
  "id": "tempo.timesheets.approve.timesheet",
  "teamId": "3",
  "groups": [ "cloud-dev-user" ], 
  "users": [ "erica", "john", "laura" ] 
}

Response

The response provides the updated permission.

{
  "id": "tempo.timesheets.approve.timesheet",
  "teamId": 3,
  "name": "Approve Timesheet",
  "description": "Permission to approve timesheet for team members",
  "weight": 10,
  "groups": [
    "cloud-dev-user"
  ],
  "users": [
    {
      "name": "laura",
      "avatar": {
        "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10139",
        "48x48": "/jira/secure/useravatar?avatarId=10139"
      },
      "jiraUser": true,
      "displayname": "Laura Penn"
    },
    {
      "name": "john",
      "avatar": {
        "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10130",
        "48x48": "/jira/secure/useravatar?avatarId=10130"
      },
      "jiraUser": true,
      "displayname": "John Steel"
    },
    {
      "name": "erica",
      "avatar": {
        "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10120",
        "48x48": "/jira/secure/useravatar?avatarId=10120"
      },
      "jiraUser": true,
      "displayname": "Erica Jefferson"
    }
  ]
}

Query Team Permissions 

JIRA users and groups can be granted different team permissions (see Data Types). 

To get all members in a team that have the Approve Timesheet permission. Requires the Tempo Team Administrators permission (or the Tempo Team Manager permission for Tempo Teams 2.x.x or earlier).

Request

In this example we use the team id 3 and set the permission-key to "tempo.timesheets.approve.timesheet". 

curl -D- -u fred:fred -X GET -H "Content-Type: application/json" http://localhost:8090/jira/rest/tempo-teams/2/permission/team/3/tempo.timesheets.approve.timesheet

Response

The response provides the team's permission.

{
  "id": "tempo.timesheets.approve.timesheet",
  "teamId": 3,
  "name": "Approve Timesheet",
  "description": "Permission to approve timesheet for team members",
  "weight": 10,
  "groups": [
    "cloud-dev-user"
  ],
  "users": [
    {
      "name": "laura",
      "avatar": {
        "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10139",
        "48x48": "/jira/secure/useravatar?avatarId=10139"
      },
      "jiraUser": true,
      "displayname": "Laura Penn"
    },
    {
      "name": "john",
      "avatar": {
        "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10130",
        "48x48": "/jira/secure/useravatar?avatarId=10130"
      },
      "jiraUser": true,
      "displayname": "John Steel"
    },
    {
      "name": "erica",
      "avatar": {
        "16x16": "/jira/secure/useravatar?size=xsmall&avatarId=10120",
        "48x48": "/jira/secure/useravatar?avatarId=10120"
      },
      "jiraUser": true,
      "displayname": "Erica Jefferson"
    }
  ]
}