# Syncing Timebooking entries bidirectional between Azure Devops and Jira Server

**URL:** https://community.exalate.com/t/syncing-timebooking-entries-bidirectional-between-azure-devops-and-jira-server/5172
**Category:** General Questions
**Tags:** exalate, jiraserver, azuredevops-jiraserv, migrated\_question, time-tracking
**Created:** [November 4, 2024, 7:47am UTC](https://community.exalate.com/t/syncing-timebooking-entries-bidirectional-between-azure-devops-and-jira-server/5172 "2024-11-04T07:47:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)
#### Post date: [November 4, 2024, 7:47am UTC](https://community.exalate.com/t/syncing-timebooking-entries-bidirectional-between-azure-devops-and-jira-server/5172/1 "2024-11-04T07:47:40Z")

</div>

_Originally asked by msch on 14 April 2022 [(original question)](https://oldcommunity.exalate.com/questions/42836704)_

* * *

Hey everyone,

i am currently trying to sync timbooking entries on tickets from Jira Server side ( Tempo ) to Azure DevOps( Time Log ) and vice versa. Has anyone already achieved that in scripting mode?

Thanks for any hints and help.

Best Regards

Mat

* * *

#### Comments:

> **Serhiy Onyshchenko commented on 22 April 2022**
>
> > Hello, msch thanks for your question.  
> > I’m afraid I don’t see the Time Log in my azure. Is it coming from an extension?  
> > Regards, Serhiy.

> **msch commented on 22 April 2022**
>
> > Hello Serhiy Onyshchenko , yes the time logging feature is coming from an extension. I was testing with [http://www.timelogextension.com/](http://www.timelogextension.com/).
> 
> Regards, Matthias

---

<div class="post-metadata">

### Author: ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)
#### Post date: [November 4, 2024, 7:47am UTC](https://community.exalate.com/t/syncing-timebooking-entries-bidirectional-between-azure-devops-and-jira-server/5172/2 "2024-11-04T07:47:42Z")

</div>

_Answer by Serhiy Onyshchenko on 22 April 2022_

Hello, msch ,

unfortunately, this addon is not supported by Exalate out-of the box.

However, what you may do is make Exalate interact with the TimeLog API from the incoming sync script using the

```auto
replica.addedWorkLogs.each { remoteWorkLog ->
  def createdTimeLog = httpClient.http(
    "POST", // method "${TIMELOG_URL}/${ORGANIZATION_ID}/timelog...", // URL
     ["queryParam1":["queryParamValue1"]], // query params
     JsonOutput.toJson(["field":"value"]), //body
     ["Content-Type": ["application/json"], "Authorization": ["BASIC ${"admin:admin".bytes.encodeBase64().toString()}"]] ) { response ->
    if (response.code >= 300) {
      debug.error("Failed to POST a time log to ${TIMELOG_URL}/${ORGANIZATION_ID}/timelog... : "+ response.body)
    } def js = new groovy.json.JsonSlurper() def json = js.parseText(response.body)
      return json }
}

```

To avoid these things syncing twice, you may link these timelogs to the remote worklogs

```auto
def trace = new com.exalate.basic.domain.BasicNonPersistentTrace(
  com.exalate.api.domain.twintrace.TraceType.WORKLOG, 
  createdTimeLog.id as String, 
  remoteWorkLog.id, 
  com.exalate.api.domain.twintrace.TraceAction.NONE, 
  true // should updates / deletes on the log be synced
)traces.add(trace) // make sure Exalate knows, that this time log was created due to that remote work-log

```

UPDATE:  
this covers the syncing Jira → Azure DevOps  
For the way-around, just use the same httpClient trick but then to ask TimeLog API for what are the time logs for this workItem

Please, let me know if you’d like me to elaborate.  
Regards, Serhiy.

* * *
