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
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);
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.