Last updated Aug 2, 2021

Rate this page:

Migrate app workflow rules from Jira server to cloud

Introduction

This tutorial shows app developers how to migrate apps workflow rules from server to cloud. There are three steps to migrate app workflow rules:

  1. Provide the app workflow rules to be migrated to cloud.
  2. Get the ID mappings for migrated workflow rules.
  3. Fix the configuration of migrated workflow rules.

We recommend reading the Getting started guide to familiarize yourself with the App migration platform.

Detailed steps

Step 1: Provide the app workflow rules to be migrated

The Jira Cloud Migration Assistant (JCMA) will migrate the app workflow rules that your app has claimed as part of product data migration. On your server app, add the interface JiraAppCloudMigrationListenerV1 on top of the class that implements DiscoverableListener to provide a map of the app workflow rules to be migrated.

Here's the method you'll have to implement:

1
2
3
4
5
public interface JiraAppCloudMigrationListenerV1 {

    Map<String, String> getSupportedWorkflowRuleMappings();

}

The method above returns a map of the server to cloud workflow rule mappings, where:

  • key is class name of server workflow rule (ex: com.example.plugins.tutorial.jira.workflow.CloseParentIssuePostFunction)
  • value is key of cloud workflow rule (ex: sample-cloud-workflow-post-function-key)

See an example

1
2
3
4
5
6
7
8
    @Override
    public Map<String, String> getSupportedWorkflowRuleMappings() {
        Map<String, String> map = new HashMap<>();
        map.put("com.vendor.impl.workflows.ParentIssueBlockingCondition", "parentIssueBlockingCondition-cloud");
        map.put("com.vendor.impl.workflows.CloseParentIssuePostFunction", "closeParentIssuePostFunction-cloud");
        map.put("com.vendor.impl.workflows.CloseIssueWorkflowValidator", "closeIssueWorkflowValidator-cloud");
        return map;
    }

During the migration, JCMA migrates app workflow rules to cloud with a disabled property.

Step 2: Get the ID mappings for migrated workflow rules

  1. Request mappings IDs: Use the Get Mappings API using the namespace jira/classic:workflowRule.
  2. Request migrated workflow rule details: When you have the mappings IDs, you can use the new API described below to request the migrated workflow rules details by ID.

Format for ID Mapping format

1
2
3
{
  {serverWorkflowRuleID}:{cloudWorkflowId}/{cloudWorkflowRuleID}
}

In the above code:

  • serverWorkflowRuleID is the ID of server workflow rule generated by JCMA (UUID).
  • cloudWorkflowId is the ID of cloud workflow.
  • cloudWorkflowRuleID is the ID of cloud workflow rule, which your apps can use to update workflow configuration (UUID).

See an example

1
2
3
4
5
{
  "b1357138-b7fd-4a7a-910f-a61d5adea551": "9674634a-c02f-4383-a4b6-fbb3ca228b23/d3a7c66e-c76b-4ac0-aa7c-a44e15a54c43",
  "c96282be-1f2f-4a28-94ce-5d6fe36ac4d8": "9674634a-c02f-4383-a4b6-fbb3ca228b23/e863d81d-fc90-41f6-afe4-271cef08a032",
  "dba809dd-433d-4ffa-9046-c1a41a17c8e4": "9674634a-c02f-4383-a4b6-fbb3ca228b23/9b2b1b87-4bfc-4197-9ee9-d5077765d4f0"
}

Step 3: Fix the configuration of migrated workflow rules

Use the new GET workflow details API to get the details of workflow rules based on workflow rule keys.

You can find the workflow rules that were migrated by finding the entries matching cloudWorkflowRuleIDs received in step 2 of this tutorial. The code below shows you how the Jira Cloud Migration Assistant migrates server app workflow rule parameters to the cloud app workflow configuration.

Sample server workflow rule config

1
2
3
4
<condition type="class">
  <arg name="statuses">workflowMode,5,atl_token,descriptorTab</arg>
  <arg name="class.name">com.example.plugins.tutorial.jira.workflow.ParentIssueBlockingCondition</arg>
</condition>

Corresponding sample cloud workflow rule config

1
2
3
{
  "value": "{ \"statuses\": \"workflowMode,5,atl_token,descriptorTab\", \"class.name\":\"com.example.plugins.tutorial.jira.workflow.ParentIssueBlockingCondition\" }"
}

The screenshot below shows you how the migrated workflow rule configuration becomes available in the configuration field of ConnectWorkflowTransitionRule:

Migrated-Jira-App-Workflow-Rule

All the app migrated workflow rules migrates to cloud in a disabled state. Your cloud app can use the cloudWorkflowRuleIds to do either of the following:

Rate this page: