Migrate from DC to Cloud
While Awesome Custom Fields isn't available on DC, there are other custom fields apps on DC that provide unique and essential features, like traffic lights, which aren't yet replicated in the Cloud. This guide will assist you in migrating from a DC app to Awesome Custom Fields in the Cloud while preserving these crucial functionalities.
Setup
Imagine you're migrating from a Data Center (DC) environment to the Cloud. Your current DC app provides a custom 'Traffic Lights' field, but there is no Cloud equivalent for this app. You want to migrate the traffic light values from the DC app to the ACF Traffic Light field in the Cloud.
Typically, a traffic light has four states: Green, Yellow, Red, and off (no value).
Migration
We will discuss 2 options to migrate the value to ACF: via CSV or Jira API. Both approaches need manual (or scripting) effort.
For further information about Cloud migration check the Atlassian documentation: Cloud migration methods for Jira | Atlassian Support
CSV import
After exporting a CSV file from your DC instance that includes the projects and issues you want to migrate, the next step is to convert the existing values to the required format for the Awesome Custom Fields field.
You can find the necessary format in the field documentation. For example, if you are working with the Traffic Light field (see: Traffic Lights), an old DC value such as green
(in simple text) needs to be transformed into an object like this: {"state": "GREEN"}
.
This transformation can be done manually or by writing a mapping script.
Once the transformation is complete, you can import the CSV file into your cloud instance. Ensure that the custom field has been created and that the correct field ID is used in the header column.
Jira API
If you want to add the field values after a successful migration, you might set the value via Jira API.
Before you start, make sure you’ve read the steps described here: https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/
For setting the custom field value we use this Jira API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put
Get custom field id
The next step is to retrieve the field id, this can be done in the Awesome Custom Fields administration (Custom field administration)
JavaScript / Node example with fetch
// replace "email" and "token"
const auth = Buffer.from(`${email}:${token}`).toString("base64");
// replace "baseUrl" and "issueKey"
const url = `${baseUrl}/rest/api/3/issue/${issueKey}`;
const headers = {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: `Basic ${auth}`,
};
const response = await fetch(url, {
method: "PUT",
headers,
body: JSON.stringify({
fields: {
customfield_10337: {state: "GREEN"} // the actual value
}
})
});
console.log(await response.text());