To learn more about Tempo products, please visit our Help Center. For support, see our Support Portal.

Migrate the Tempo Account Custom Field from Data Center to Cloud

Customers that migrate from Jira Data Center to Jira Cloud need to migrate their Tempo data setup between the Jira instances. One migration task is to migrate the Tempo Account setup between their instances.

This article describes a recipe for Exporting/Importing the Tempo Accounts and to adjust the Tempo Account custom field in the destination instance. The same approach can also be applied for a migration from Cloud to Data Center.

The guidelines below are based on using the Jira and Tempo REST APIs. For each of the REST APIs you will need an access token. If you are unsure how to retrieve these tokens follow the instructions for Jira and Tempo.

We assume that all projects and issue keys exist in both your Data Center and Cloud instances.

Instructions

Follow the steps below:

  1. Export all Tempo Accounts from your Data Center instance using the csv export functionality. Be advised that archived accounts are NOT exported.

  2. Import all Tempo Accounts into your Cloud instance using the csv import functionality. Be advised that the account status is not mapped in the import function and all accounts will default to the “OPEN” status.

  3. Export all Jira issue data from your Data Center instance to a csv file. The key fields you need to have included in the export are the Jira issue key and the Tempo Account custom field value.

  4. Extract the Tempo Accounts that you have imported in step 2 from your Cloud instance. This is necessary to get the new associated ID. You need to do the following call to the Tempo REST API.
    curl --request GET 'https://api.tempo.io/core/3/accounts' -H 'Authorization: Bearer {TempoAPIAccessToken}'
    This will return a JSON with all Tempo accounts. You will need to parse the JSON file in order to work with it in Excel. E.g. https://json-csv.com/ or similar.

  5. Match the Account name from Data Center (retrieved from step 3) to the new Tempo Account ID (retrieved from step 4). The Accounts can be matched by Account Name or Account Key. As a final result you should have a new column in your exported list from step 3 that represents the Tempo Account ID in your destination Jira Cloud instance.

  6. Now you need to get the custom field ID of the Tempo Account field in your Jira Cloud destination instance. You can achieve this with calling a Jira REST endpoint:
    curl --request GET 'https://{JiraCloudUrl}/rest/api/3/field' -H'Authorization: Basic {AtlassianAPIAccessToken}’
    Within the response of that call you will find the information of the Tempo Account and the Tempo Team field:

    "id": "customfield_10201", "key": "io.tempo.jira__account", "name": "Account",

    Look for the key "io.tempo.jira__account". You will need the corresponding id (customfield_xxxxx).

  7. Now you will need to update the Jira Account with the help of your final list of step 5. You will need to do an API call of each single line:

    curl --request PUT 'https:///{JiraCloudUrl}/rest/api/3/issue/{IssueKey}' \ -header 'Content-Type: application/json' \ -header 'Authorization: Basic {AtlassianAPIAccessToken}' \ -data-raw '{"fields": {"customfield_xxxxx": {TempoAccountID}}

    You will need to replace the parameter in “{}” with the correct values from your instance. You can copy the commands in a script file that you can run from any command line tool similar to how it’s described in this article

The Jira REST update command of the Jira issue may result in positive response (update succeeded) but it might also fail for any reason. The most common reason for a failed update is that the Tempo Account is not linked to the Jira project.
It might be a good practices to log the outcome (responses) from the update API call to a logfile to be able to investigate any received errors. Fix the errors and run the updates again

https://tempo-io.atlassian.net/wiki/spaces/KB/pages/1400471783

https://tempo-io.atlassian.net/wiki/spaces/KB/pages/488931333

https://tempo-io.atlassian.net/wiki/spaces/KB/pages/390299676