Tempo Timesheets REST API -

14sauravghosh March 11, 2020

Trying to use the Tempo Timesheets REST API to pull info using Google Apps Script. Getting a 404 error for this rather simple code.

var baseURL = "https://xxx.atlassian.net/rest/tempo-timesheets/4/worklogs?dateFrom=2020-01-01&dateTo=2020-02-02";

var username = "xxx@xxxyyy.com";
var password = "zzzzzzzzzzzzzzzzz";
var encCred = Utilities.base64Encode(username + ":" + password);

var options = {
contentType: "application/json",
headers: {"Authorization":"Basic "+ encCred},
muteHttpExceptions : true
};

var response = UrlFetchApp.fetch(baseURL, options);
Logger.log(response);

Looking at this everything seems alright. https://www.tempo.io/server-api-documentation/timesheets#operation/searchWorklogs

 

Any help would be much appreciated.

 

1 answer

1 accepted

0 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 20, 2020

Hi,

I understand you're using a Jira Cloud site, and want to be able to get some Tempo worklog via the REST API.  However the documentation link you included is actually for the Server version of Tempo.  I am afraid that the authorization needed in Cloud is a bit different. 

Check out https://tempo-io.github.io/tempo-api-docs/ it has some details on how to authorize there.

You can use the REST API to interact with the data your permissions give you access to. To do so, you will need to generate a Tempo OAuth 2.0 token.

Please note that an OAuth 2 token is not the same kind of token as Atlassian Cloud API Tokens.  However there are steps in the Tempo guide you can follow to be able to make such REST API requests of that data. 

I hope this helps.

Andy

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events