Sync up a client JIRA Tempo timesheet with vendor Harvest

Jordan Lucas May 20, 2020

I have a client where we use their JIRA instance and will start logging our time directly into their system using Tempo.

 

Since we are a vendor of their's we still need those timesheets to be in our time tracking system (Harvest). I am wondering if anyone knows of a relatively easy process to sync the two systems up so our team does not have to log time in both areas.

 

Thanks

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2020

Hello,

You could use any scripting add-on for it like Power Scripts, ScriptRunner, MyGroovy and so on.

If you want to use the Power Scripts add-on then you could do it the following way:

1. Create a scheduled job, which would check new logged in time in required projects, for example, for the previous day.

2. Use Jira Rest APi to log the found time in the required Jira instance.

Your code would be something like this:

struct Wrk {
string comment;
date started;
number timeSpentSeconds;
}

string [] keys = selectIssues("your jql query");
date startOfDay = startOfDay(currentDate()) - "1d";

date endOfDay = startOfDay(currentDate()) ;

HttpRequest request;
HttpHeader header = httpCreateHeader("Content-Type", "application/json");
request.headers += header;
HttpHeader authHeader = httpBasicAuthHeader("admin", "admin");
request.headers += authHeader;


for (JWorklog wrklog in getWorklogsForIssues(startOfDay, endOfDay, keys)) {
Wrk wrk;
wrk.comment = wrklog.comment;
wrk.started = wrklog.startDate;
wrk.timeSpentSeconds = wrklog.timeSpent;
string result = httpPost("https://yourjirainstance/rest/api/2/issue/{issueIdOrKey}/worklog", request, wrk);


}


  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events