Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Sync up a client JIRA Tempo timesheet with vendor Harvest

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

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
Community showcase
Published in Marketplace Apps & Integrations

Do Not Lose your Customer’s Trust

Missing deadlines is one of the biggest problems every team lead wants to avoid when dealing with managed services. When the customer contracts your company to help with IT services it is expected th...

312 views 0 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you