Document toolboxDocument toolbox

REST APIs for Jira Server / Data Center

The code examples provided below are for curl and you will need to adapt them to your preferred means of dealing with REST APIs. All information provided in curly brackets “{}” need to be replaced with the variables from your instance.

Teams

Besides the basic information for a Tempo team, you will also need to fetch all related team information such as team members and permissions. To get all teams set up on your Jira Server instance call:

curl --request GET 'http://{youJiraUrl}/rest/tempo-teams/2/team' -H 'Authorization: Basic {username:passwordBase64encoded}'

In the JSON response you will get the IDs of all teams within your Jira instance. The ID is needed for all further calls to retrieve the team members and the permission roles of your teams.

You get all team memberships with a POST call to the /rest/tempo-teams/2/team/members endpoint.

curl --request POST 'http://{youJiraUrl}/rest/tempo-teams/2/team/members' \-H 'Content-Type: application/json' \-H 'Authorization: Basic {username:passwordBase64encoded}' \--data-raw '{"ids": ["4","22","6"],"onlyActive": true}'

Each single entry of a team member object will include a reference to the Tempo team the team member belongs to (e.g. "teamId": 6).

For the permission set of a Tempo team use the endpoint:

curl --request GET 'http://{youJiraUrl}/rest/tempo-teams/2/permissionGroups/team/{TeampoTeamid}' -H 'Authorization: Basic {username:passwordBase64encoded}'

Each team can have multiple permission groups and each permission group has a set of predefined permissions:

Team permissions are the same on Tempo for Cloud but cannot be imported by a REST endpoint.

If you wish to migrate Tempo teams programmatically you will need to export the Tempo teams roles as well. The roles are returned from the endpoint:

The default team role will be applied to team members that are added to a team from a Jira group.

Workload and Holiday Schemes

To export workload schemes use:

You will need to get the user assignments to the workload schemes by looping through all existing workload schemes:

To export holiday schemes, use a similar approach but replace “workloadscheme” with “holidayscheme”:

And to get the members of the holiday schemes use:

Each user can only be assigned to one workload and one holiday scheme. Assigning a user to a holiday scheme will unassign the user from the previous holiday scheme.

Timesheet Approvals

All timesheets of Timesheet users can have three different statuses: “Ready to submit”, “Waiting for approval” and “Approved”. A declined timesheet gets back to the status “Ready to submit”. Timesheets of users and their status can only be retrieved from an REST API endpoint. Timesheets are queried for one team and one period at once. In order to get all timesheets for all users you will need to loop through all teams and all time periods.

The endpoint to use for this is:

A list of available/existing periods can be retrieved by calling: 

The Timesheet history from a user can be extracted from the endpoint:

Please note that the Timesheet history can't be imported directly into the Cloud instance. You have the option to do all Timesheet actions (submit, reject, approve) from an REST endpoint but the effective date will always be the date you make the REST call. The historic date of the timesheet log cannot be preserved.