Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains the steps required when migrating a Jira Cloud instance to Jira Server/Data Center when you were using JMWE workflow extensions on your JIRA Cloud instance. 

...

Because of the way Atlassian's Connect framework is implemented, workflows extensions (validators, conditions and post-functions) provided by add-ons are incompatible between Jira Server/Data Center and Jira Cloud. The entire JMWE configuration is contained within the workflows themselves. So you need to take a backup of your entire Jira Cloud instance, identify the workflows and transitions that use JMWE workflow extensions, and fix them.

Challenges:

Workflows using JMWE post-functions/conditions/validators in the Cloud will break on the Server/Data Center because post-function configurations are incompatible with their Cloud equivalents

  • Some workflow extensions need to be completely recreated looking at their equivalents in the Cloud, followed by deleting the existing one in the Server/Data Center

  • Some workflow extensions might use Nunjucks templates either to execute the post-function conditionally or set a field value or comment an issue. Wherever you use Nunjucks templates, write its equivalent Groovy script. See Customizing further with Groovy scripts. You can test your script result using the Groovy script tester. Examples: Uncheck/Unselect an option in Nunjucks and Uncheck/Unselect an option in Groovy and Checking the value of a multi-valued field in Nunjucks and Checking the value of a multi-valued field in Groovy. Wherever you use Nunjucks templates on the configuration screen select:

    • Groovy expression/Groovy template as Value type in the post-functions that set a field value

    • Groovy expression/Groovy template as Comment type in the post-functions that comment an issue

  • On Jira Cloud, you can execute post-functions as the add-on user, the current user, or any specific user. On Jira Server/Data Center you can either execute it as the current user or any specific user. If your post-functions has option Run as add-on user or Run as current user, Leave it blank to execute it as the current user. If it is Run as a user select the same user in Jira Server/Data Center.

Missing features:

Some features of workflow extensions mentioned below are unavailable in the Server/Data Center. 

  • Send notifications: In Jira Cloud, post-functions are run after the transition and transition notifications are not sent. Hence this option was helpful. But in Jira Server post-functions are run within the transition and hence transition notifications are sent. So this option is irrelevant here.

  • Delayed execution: This option is irrelevant in Jira Server/Data Center because post-functions in Jira Server/Data Center are run synchronously during/as a part of the transition. 

Features unavailable in specific post-functions:

...

Workflow extension name

...

Unavailable feature(s)

...

Field is required validator

...

Ignore context

...

Field modified validator

...

  • Groups exempt from the validator

  • Optional error message

...

Copy field value from linked issues

...

  • Destination field

  • "Any" link type in Issue link type

  • Create missing value(s)

  • Ignore empty values

...

Copy field value to linked issues

...

  • Destination field

  • "Any" link type in Issue link type

  • Create missing value(s)

  • Ignore empty values

...

Copy field value from parent

...

  • Destination field

  • "Any" link type in Issue link type

  • Create missing value(s)

  • Ignore empty values

...

Copy field value to parent

...

  • Destination field

  • "Any" link type in Issue link type

  • Create missing value(s)

  • Ignore empty values

...

Copy value from field to field

...

  • Create missing value(s)

  • Ignore empty values

...

Create issue

...

Create comment as

...

Set field value

...

  • Treat value as JSON

  • Create missing value(s)

  • Ignore empty values

...

Set field value from User Entity Property value

...

  • Create missing value(s)

  • Ignore empty values

...

Set field value of linked issues

...

  • Treat value as JSON

  • Create missing value(s)

  • Ignore empty values

...

Transition current issue

...

  • Handling of transition screen and fields on it is not available

...

Transition linked issues

...

  • "Any" link type in Issue link type

  • Handling of transition screen and fields on it is not available

...

Transition parent issue

...

Migrating workflows

Before you begin fixing your workflows, publish all your workflows to avoid duplicate work (between the draft and corresponding published workflow)

Table of Contents

Step 1 - Backup the Cloud instance and open the XML file

  1. Using JIRA's XML backup utility backup your entire Jira Cloud instance for server.

  2. Unzip the backup.

  3. Find the entities.xml file.

  4. Open it in an editor that supports very large files.

...

  1. Find the text "DelegatingPostFunction"

  2. Work your way up on the file from the line that contains "DelegatingPostFunction" to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag.

    Image RemovedImage Added
  3. Write down the transition name in the table.

  4. Work your way up further on the file from the line you have found the transition, to find the name of the workflow. You can identify it under the <Workflow> tag. Refer to the above image.

  5. Write down the workflow name.

  6. Find the next instance of DelegatingPostFunction

  7. Repeat steps 2 to 6 until you reach the end of the file.

  8. Repeat steps 1 to 7 but searching for RemoteWorkflowPostFunctionProvider instead of DelegatingPostFunction

  9. Now you will have a list of transitions and their corresponding workflow name.

...

Step 3 - Manually edit the XML file

  1. class.name changes

    Most issues with JMWE Validators and Conditions can be resolved by a simple search and replace. For each entry in the table below replace the text in the first column (Current class.name) with the text in the second column (New class.name) throughout the file using ReplaceAll.

...

  1. Open the table prepared in Step 2.

  2. On Jira Server/Data Center and Jira Cloud:

    1. Go to the Administration icon 

      Image Removed

       and click on it. section

    2. Click on the cogwheel

    3. Go to Issues → Workflows

Recreate the post-functions in Jira Server/Data Center

...

    1. Locate the first strange looking post-function in Jira Server/Data Center. You can easily identify JMWE post-functions imported from Cloud because they appear strange, with either Class: com.atlassian.jira.workflow.function.DelegatingPostFunction or Class: com.atlassian.plugin.connect.jira.workflow.RemoteWorkflowPostFunctionProvider similar to this:

      Image RemovedImage Added
    2. Locate the same post-function in Jira Cloud by its position in the list and edit it to see its full configuration.

    3. Recreate the post-function:

      1. Click on Add post-function in Jira Server/Data Center.

      2. Recreate the post-function looking at its equivalent configuration in Jira Cloud. While recreating the post-function you might notice some known incompatibilities in JMWE Server/Data Center. 

      3. Move the post-function right before the existing post-function

      4. Delete the existing post-function in Jira Server/Data Center.

...