Confluence has been updated to version 6.15.9


This article shows how to synchronize Tempo worklogs using External scripts library.


Disclaimer

  • There is no guarantee on its stability, as it didn't run through a complete validation cycle
  • The feature can evolve and even be retracted in case it doesn't meet our quality criteria
  • We love to get feedback on experimental features which can be sent to support@exalate.com


Introduction

Exalate app allows synchronizing Tempo worklogs.  

Synchronization of the Tempo worklogs requires an exchange of the following data:

  • worklog author
  • issue
  • description
  • date: created at, update at, start date, start time,
  • worked (time spent)
  • remaining estimate
  • tempo worklog id (only for Jira Cloud)
  • Jira worklog id (if the remote side does not have tempo app, tempo worklogs would be synced into a Jira worklog fields)


Exalate supports only create worklog events synchronization. If the worklog has been updated or deleted these changes would not be synchronized.


Tempo synchronization on Jira Cloud

You don't need to upload external scripts manually it's already deployed on the Exalate app server.

Worklog Author is a Jira user, this means that Exalate requires exchanging information from user fields.  Jira Cloud user may have different user access on different instances using the same email address. Exalate uses Tempo Cloud REST API to get access to the tempo worklogs. 


The script works only in case when the worklog author is a Jira Cloud user on both sides.


Configuration

1. Generate Access Token

Exalate requires access to Tempo. To grant secure, temporary access to Tempo you need to create a user access token. This access token is based on Jira Cloud user current permissions. 

Required permissions

The user who generated the access token must have the following permission:

  • Jira permission
    • Create worklogs
    • View all worklogs
    • Log work for others
    • Work on issues
  • Tempo permissions
    • view team worklogs
    • manage team worklogs

Generate the Access Token under Tempo settings - API integration tab in your Jira Cloud settings.


2. Call the script from the Sync Rules

Source side (cloud)

To send the data from tempo add the code below to the Outgoing sync(data filter)

TempoWorkLogSync.send(
	"OM72xP3i1IxEgUT4YR1dmAHNRXcOEw",  // replace OM72xP3i1IxEgUT4YR1dmAHNRXcOEw with the previously generated access token
	replica, 
	issue, 
	httpClient, 
	nodeHelper
) 

Destination side (cloud)

To apply received tempo worklogs locally when creating an issue, add the code below to the Incoming sync processor

// the issue must be available 

if (!firstSync) {
	TempoWorkLogSync.receive(
	  "OM72xP3i1IxEgUT4YR1dmAHNRXcOEw", // replace OM72xP3i1IxEgUT4YR1dmAHNRXcOEw with the previously generated access token
	  replica,
	  issue,
	  httpClient,
	  traces,
	  nodeHelper
	)
}

Tempo synchronization on Jira Server

Tempo stores all worklogs in the default Jira worklog fields. Therefore you don't need to use any external script to synchronize tempo worklogs on Jira Server. 

Jira worklogs synchronization requires worklog author lookup. By default, Exalate tries to find the worklog author on the remote side and create a worklog on behalf of that author. 

The author lookup is performed by email, but you can also configure other ways to find corresponding users on the local system (by full name, username or any other arbitrary logic that you might have).

Below you can find the example of the simple worklogs synchronization on Jira Server.


Source side (Server)

To send the data from tempo add the code below to the Outgoing sync(data filter)

replica.workLogs = issue.workLogs
replica.remainingEstimate = issue.remainingEstimate

Destination side (Server)

To apply received tempo worklogs locally add the code below to the Incoming sync for new issues(create/change processor)

issue.workLogs = workLogHelper.mergeWorkLogs(issue, replica)

Additionally, you can configure user mapping in the Incoming sync processors or set a default worklog author in case the original author is not found.

For more details check workLogs synchronization on Jira Server.


See also