Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Syncing Timebooking entries bidirectional between Azure Devops and Jira Server

 
2
1
0

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

  1. Serhiy Onyshchenko

    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.

  2. msch

    Hello Serhiy Onyshchenko , yes the time logging feature is coming from an extension. I was testing with  http://www.timelogextension.com/.


    Regards, Matthias

CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1

    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 

    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

    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.

      CommentAdd your comment...