Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Cloud

Due to security reasons, Servlet API on Cloud is no longer available. 2020-04-01 | Tempo has Decommissioned the Servlet API /wiki/spaces/HCA/pages/763691139 . Timesheet approvals are associated with a user and a given period, the approval status is not directly linked to individual worklogs.

...

There are 2 ways to retrieve approval data - one by team and another by user.

By Team:

To get approval by Team - https://api.tempo.io/4/timesheet-approvals/team/{teamId} with “from” and “to” period parameters: This returns you each team member’s approval details such as period, status, worklogs, etc.

...

If there are users who work in multiple teams at the same time, you will get duplicate records for the same users.

By User:

To get approval by User - https://api.tempo.io/4/timesheet-approvals/user/{accountId} with “from” and “to” parameters (see Periods above). You can get a list of user accountId’s from Jira REST API .

Expand
titleGET https://api.tempo.io/4/timesheet-approvals/user/5b198320e249415c02f69600?from=2021-06-01&to=2021-06-30
Code Block
languagejson
{
    "self": "https://api.tempo.io/4/timesheet-approvals/user/5b198320e249415c02f69600?from=2021-06-01&to=2021-06-30",
    "period": {
        "from": "2021-06-01",
        "to": "2021-06-30"
    },
    "requiredSeconds": 604800,
    "timeSpentSeconds": 0,
    "status": {
        "key": "OPEN"
    },
    "user": {
        "self": "https://tempo-support-1.atlassian.net/rest/api/2/user?accountId=5b198320e249415c02f69600",
        "accountId": "5b198320e249415c02f69600",
        "displayName": "Susan Wu"
    },
    "actions": {
        "submit": {
            "self": "https://api.tempo.io/4/timesheet-approvals/user/5b198320e249415c02f69600/submit?from=2021-06-01&to=2021-06-30"
        }
    },
    "worklogs": {
        "self": "https://api.tempo.io/4/worklogs/user/5b198320e249415c02f69600?from=2021-06-01&to=2021-06-30"
    }
}

...

Data Center

With Server Data Center Servlet API, it’s much easier to get timesheet approval status for worklogs within a selected period in XML, Excel, or test data format, as per our Server Data Center API documentation. There are more parameters in the documentation to include in the call.

To get approval by Worklogs - http://{serverdatacenter}/plugins/servlet/tempo-getWorklog/ with tempoApiToken, format, addApprovalStatus, dateFrom, dateTo, etc..

...