This article is for Cloud. Visit Data Center
REST API Integrations
You can use REST API integrations in Time Tracker for Jira Cloud.
REST Endpoint
In addition to Jira native support for loading worklogs via REST, you can get worklogs in json
format, including issue data, by using the REST endpoint add-on, available at https://timesheet-reports-gadgets.tempo.io/atlassian-connect.json
with your Apikey
, as described below.
timesheet-reports-gadgets.tempo.io
has to be unchanged, but you will need to provide your Apikey
(which is your Jira url
and encoded user). You can get your key from the General Configuration Settings.
Supported parameters:
start (or startDate): Required start date in YYYY-MM-DD format.
end (or endDate): Required end date in YYYY-MM-DD format.
user: Optional user account id.
groups: Optional group names.
filterOrProjectId: Optional, e.g.
filterOrProjectId=project_TIMES&filterOrProjectId=filter_10010
moreFields: Optional list of fields to include in issue details.
In REST, it may also be possible to use the url from a report page after the hash-bang( #!) delimiter.
In the case of a long polling request, the response will contain status 202 and content-type omitted. Also, several empty lines will be added before the first relevant row. Please parse it accordingly; e.g., skip empty lines for csv parsing. Request and response example:
$ curl -H "Authorization: Apikey T/6r47/KrnOPGqrtyI3aP/KAxnUsJBj7PzdkAqpvl6ijegFscT3pPqWf2pVRWSmL" \
https://timesheet-reports-gadgets.tempo.io/api/1/worklog\?start=2017-08-21\&end=2017-08-31\&groups=administrators\&filterOrProjectId=project_DEMO
[
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "10000",
"self": "https://primetimesheet.atlassian.net/rest/api/2/issue/10000",
"key": "DEMO-1",
"fields": {
"summary": "As an Agile team, I'd like to learn about Scrum >> Click the \"DEMO-1\" link at the left of this row to see detail in the Description tab on the right",
"issuetype": {
"self": "https://primetimesheet.atlassian.net/rest/api/2/issuetype/10000",
"id": "10000",
"description": "Created by Jira Agile - do not edit or delete. Issue type for a user story.",
"iconUrl": "https://primetimesheet.atlassian.net/images/icons/issuetypes/story.svg",
"name": "Story",
"subtask": false
},
"customfield_10007": null,
"project": {
"self": "https://primetimesheet.atlassian.net/rest/api/2/project/10000",
"id": "10000",
"key": "DEMO",
"name": "Demonstration Project",
"avatarUrls": {
"48x48": "https://primetimesheet.atlassian.net/secure/projectavatar?avatarId=10324",
"24x24": "https://primetimesheet.atlassian.net/secure/projectavatar?size=small&avatarId=10324",
"16x16": "https://primetimesheet.atlassian.net/secure/projectavatar?size=xsmall&avatarId=10324",
"32x32": "https://primetimesheet.atlassian.net/secure/projectavatar?size=medium&avatarId=10324"
},
"projectCategory": {
"self": "https://primetimesheet.atlassian.net/rest/api/2/projectCategory/10000",
"id": "10000",
"description": "",
"name": "Test Category"
}
},
"issuelinks": [],
"priority": {
"self": "https://primetimesheet.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://primetimesheet.atlassian.net/images/icons/priorities/medium.svg",
"name": "Medium",
"id": "3"
},
"resolution": null,
"status": {
"self": "https://primetimesheet.atlassian.net/rest/api/2/status/10000",
"description": "",
"iconUrl": "https://primetimesheet.atlassian.net/",
"name": "To Do",
"id": "10000",
"statusCategory": {
"self": "https://primetimesheet.atlassian.net/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
},
"worklog": {
"worklogs": [
{
"author": "admin",
"comment": "test",
"created": "2017-08-21T22:02:27.140+0200",
"updated": "2017-08-21T22:02:27.140+0200",
"visibility": {
"type": "group",
"value": "administrators"
},
"started": "2017-08-21T20:02:00.000Z",
"timeSpent": "1h",
"timeSpentSeconds": 3600,
"id": "21609",
"issueId": "10000"
}
]
}
}
}
]
Running REST API Standalone
It is also possible to run the REST service as a standalone, or embed an underlying worklog extraction script into other services, without installing the add-on. See the jiratime project for source code, and feel free to use it as needed.
Export to CSV
You can pull reports in XLS format or raw data in CSV format with:
a link, such as
https://timesheet-reports-gadgets.tempo.io/atlassian-connect.json/exportView.xls?start=2018-10-01
orhttps://timesheet-reports-gadgets.tempo.io/atlassian-connect.json/exportData.csv?start=2018-10-01
with HTTP header "Authorization: Apikey KEY" or with the query parameter "Apikey=KEY"basic authentication, such as Apikey:KEY for username:password.
The KEY is obtained from the General Configuration Settings.
Examples:
Apikey query parameter in URL:
https://timesheet-reports-gadgets.tempo.io/atlassian-connect.json/exportData.csv?start=2018-10-01&Apikey=T%2F6r47%2FKrnOPGqrtyI3aP%2FKAxnUsJBj7PzdkAqpvl6ijegFscT3pPqWf2pVRWSmL
. The Apikey needs to be urlencoded (/, + and = replaced with %2F, %2B a %3D).
Basic authentication (with curl):
$ curl -u Apikey:T/6r47/KrnOPGqrtyI3aP/KAxnUsJBj7PzdkAqpvl6ijegFscT3pPqWf2pVRWSmL \
https://timesheet-reports-gadgets.tempo.io/atlassian-connect.json/exportData.csv\?start=2018-10-01
Apikey Authorization header (with curl):
$ curl -H "Authorization: Apikey T/6r47/KrnOPGqrtyI3aP/KAxnUsJBj7PzdkAqpvl6ijegFscT3pPqWf2pVRWSmL" \
https://timesheet-reports-gadgets.tempo.io/atlassian-connect.json/exportData.csv\?start=2018-10-01
Â