This article explains the steps required when migrating a JIRA Server instance to JIRA Cloud when you were using JMWE workflow extensions on your JIRA Server instance.
Background:
Because of the way Atlassian's Connect framework is implemented, workflow extensions (validators, conditions and post-functions) provided by add-ons are incompatible between JIRA Server and JIRA Cloud. The entire JMWE configuration is contained within the workflows themselves. So you need to take a backup of your entire JIRA Server instance, identify the workflows and transitions that use JMWE workflow extensions, and fix them.
Challenges
Workflows using JMWE post-functions/conditions/validators in the Server will break on the Cloud because post-function configurations are incompatible with their Cloud equivalents.
...
- The Assign to last role member and Assign to role member post-functions do not have the option to customize the assignment
- Send Issue commented notification: This option is irrelevant in Comment issue and Comment linked issues post-functions of JIRA Cloud because the notifications will always be sent.
- Use value before current transition: The Copy value from field to field post-function does not have the option to use the value before the current transition
Migrating workflows
Table of Content Zone |
---|
|
Step 1 - Backup the Server instanceBefore you begin fixing your workflows, publish all your workflows to avoid duplicate work (between the draft and corresponding published workflow) |
Table of Content Zone |
---|
|
Step 1 Step 2 - Backup the Server instanceUsing JIRA's XML backup utility backup your entire JIRA Server instance. Step 2 3 - Manually edit the XML- Extract the backup and open the
entities.xml file with any text editor (one that can open large files) - Edit the XML file to delete workflow extensions that are unavailable
- Delete JMWE conditions that are unavailable
- Linked Issues Status Condition
- Search for
<arg name="class.name">com.innovalog.jmwe.plugins.conditions.LinkedIssuesStatusCondition</arg> - You should see XML for the condition similar to this:Image Modified
- Remove the entire
<condition>...</condition> element. - Find the next instance of the search.
- Repeat steps 3 and 4 until you reach the end of the file.
- Scripted (Groovy) Condition
- Search for
<arg name="class.name">com.innovalog.jmwe.plugins.conditions.GroovyCondition</arg> - You should see XML for the condition similar to this:
- Remove the entire
<condition>...</condition> element. - Find the next instance of the search.
- Repeat steps 3 and 4 until you reach the end of the file.
- Delete JMWE validators that are unavailable
- Linked Issues Status Validator
- Search for
<arg name="class.name">com.innovalog.jmwe.plugins.validators.LinkedIssuesStatusValidator</arg> - You should see XML for the validator similar to this:
- Remove the entire
<validator>...</validator> element. - Find the next instance of the search.
- Repeat steps 3 and 4 until you reach the end of the file.
- Scripted (Groovy) Validator
- Search for
<arg name="class.name">com.innovalog.jmwe.plugins.validators.GroovyValidator</arg> - You should see XML for the validator similar to this:
- Remove the entire
<validator>...</validator> element. - Find the next instance of the search.
- Repeat steps 3 and 4 until you reach the end of the file.
- Delete JMWE post-functions that are unavailable
- Scripted (Groovy) Post-function
- Search for
<arg name="class.name">com.innovalog.jmwe.plugins.functions.GroovyFunction</arg> - You should see XML for the function similar to this:
- Remove the entire
<function>...</function> element. - Find the next instance of the search.
- Repeat steps 3 and 4 until you reach the end of the file.
- Edit the XML file to replace the Hide transition and Field is required validator with their equivalents
- Hide transition
- Search for
<arg name="class.name">com.innovalog.jmwe.plugins.conditions.NonInteractiveCondition</arg> - You should see XML for the condition similar to this
- Replace with
<arg name="class.name">com.atlassian.jira.workflow.condition.RemoteOnlyCondition</arg> throughout the file using ReplaceAll. - The replaced validator should look similar to this:Image Modified
- Field is required validator
- Search for
<arg name="class.name">com.innovalog.jmwe.plugins.validators.FieldRequiredValidator</arg> - You should see XML for the validator similar to thisImage Modified
- Edit the
<validator>...</validator> element:
- Replace the argument
<arg name="hidFieldsList"></arg > with <arg name="contextHandling">no</arg> - On the next line replace
fieldKey with hidFieldsList - Replace comma - , (separating the fields) with "@@"
- Add @@ after the last field
- Replace
<arg name="class.name">com.innovalog.jmwe.plugins.validators.FieldRequiredValidator</arg> with <arg name="class.name">com.atlassian.jira.workflow.validator.FieldRequiredValidator</arg> - The replaced validator should look similar to this:
- Find the next instance of the search.
- Repeat step iii until you reach the end of the file.
By now, you will have completed the XML fixes for workflow conditions, validators and unavailable workflow post-functions. The remaining fixes must be done by recreating/modifying the post-function and deleting the existing ones. Step 3 4 - Identify workflows and transitions using JMWE post-functions that need to be recreatedAt the end of this step, you will create a table with the workflow name and the transition names of all the workflows containing JMWE post-functions that need to be recreated - Unlink Issues post-function
Search for the text - <arg name="class.name">com.innovalog.jmwe.plugins.functions.UnlinkIssuesFunction</arg> Work your way up on the file from the line that contains <arg name="class.name">com.innovalog.jmwe.plugins.functions.UnlinkIssuesFunction</arg> to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag. Image ModifiedWrite down the transition name in the table. Transition Name | Workflow Name |
---|
Done |
|
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. Image ModifiedWrite down the workflow name Transition Name | Workflow Name |
---|
Done | SFVFUP |
Find the next instance of <arg name="class.name">com.innovalog.jmwe.plugins.functions.UnlinkIssuesFunction</arg> - Repeat steps b to g until you reach the end of the file.
Now you will have a list of transitions and their corresponding workflow name. List of transitions | Workflow Name |
---|
Start Progress, Done | SFVFUP | Start Progress, Reject | TPI |
- Link issues to the current issue post-function
- Search for the text
<arg name="class.name">com.innovalog.jmwe.plugins.functions.LinkIssuesFunction</arg> Work your way up on the file from the line that contains <arg name="class.name">com.innovalog.jmwe.plugins.functions.LinkIssuesFunction</arg> to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag. Write down the transition name in the table. Transition Name | Workflow Name |
---|
Done |
|
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. Write down the workflow name. Transition Name | Workflow Name |
---|
Done | SFVFUP |
Find the next instance of <arg name="class.name">com.innovalog.jmwe.plugins.functions.LinkIssuesFunction</arg> Repeat steps b to g until you reach the end of the file. Now you will have a list of transitions and their corresponding workflow name. List of transitions | Workflow Name |
---|
Start Progress, Done | SFVFUP | Start Progress, Reject | TPI |
- Email issue post-function
- Search for the text
<arg name="class.name">com.innovalog.jmwe.plugins.functions.EmailIssueFunction</arg> Work your way up on the file from the line that contains <arg name="class.name">com.innovalog.jmwe.plugins.functions.EmailIssueFunction</arg> to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag. Write down the transition name in the table. Transition Name | Workflow Name |
---|
Done |
|
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. Write down the workflow name. Transition Name | Workflow Name |
---|
Done | SFVFUP |
Find the next instance of <arg name="class.name">com.innovalog.jmwe.plugins.functions.EmailIssueFunction</arg> Repeat steps b to g until you reach the end of the file. Now you will have a list of transitions and their corresponding workflow name. List of transitions | Workflow Name |
---|
Start Progress, Done | SFVFUP | Start Progress, Reject | TPI |
- Create issue post-function
- Find for the text
<arg name="class.name">com.innovalog.jmwe.plugins.functions.CreateIssueFunction</arg> Work your way up on the file from the line that contains <arg name="class.name">com.innovalog.jmwe.plugins.functions.CreateIssueFunction</arg> to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag. Write down the transition name in the table. Transition Name | Workflow Name |
---|
Done |
|
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. Write down the workflow name. Transition Name | Workflow Name |
---|
Done | SFVFUP |
Find the next instance of <arg name="class.name">com.innovalog.jmwe.plugins.functions.CreateIssueFunction</arg> Repeat steps b to g until you reach the end of the file. Now you will have a list of transitions and their corresponding workflow name. List of transitions | Workflow Name |
---|
Start Progress, Done | SFVFUP | Start Progress, Reject | TPI |
- Now you will have three tables with List ot transitions, Workflow name that contain post-functions to be recreated.
Sort the table by Workflow name Workflow Name | List of transitions |
---|
SFVFUP | Start Progress, Done | TPI | Start Progress, Reject | TLI | Done, Reopen |
Step 4 5 - Identify workflows and transitions using JMWE post-functions that need reworkIn this step identify workflows and transitions using JMWE post-functions that need rework. At the end of this step you will have three tables with workflows, transitions and post-functions that have: - Groovy scripts in the Conditional execution section
- Groovy expressions or Groovy templates to set a field of an issue or comment an issue
- a specific user in the Run as section
Identify post-functions with Conditional execution script- Search for the text
<arg name="useGroovyCondition">yes</arg> - Work your way up and look at
<arg name="class.name"> to identify the name of the post-function (look at the end of the line). - Ignore and find the next instance of the search if it is either of the following:
<arg name="class.name">com.innovalog.jmwe.plugins.functions.CreateIssueFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.EmailIssueFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.LinkIssuesFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.UnlinkIssuesFunction</arg>
If not write down the name of the post-function looking at the class name. Post-function name | Transition name | Workflow name |
---|
Transition Linked issues |
|
|
Work your way up on the file from the line that contains <arg name="useGroovyCondition">yes</arg> to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag. Write down the transition name in the table. Post-function Name | Transition Name | Workflow Name |
---|
Transition Parent issue | Done |
|
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. Write down the workflow name. Post-function Name | Transition Name | Workflow Name |
---|
Transition Parent issue | Done | SFVFUP |
Find the next instance of the search Repeat steps 2 to 10 until you reach the end of the file. Now you will have a list of transitions and their corresponding workflow name for post-functions that have a conditional execution script. Workflow Name | List of transitions | Post-functions with Conditional script |
---|
SFVFUP | Start Progress | Transition linked issues, Set field value | Done | Set field value of linked issues, | TPI | Start Progress | Set field value of linked issues | Reject | Comment issue |
- Identify post-functions with
Groovy template as the Value type - Search for the text
<arg name="valueType">template</arg> - Work your way up and look at
<arg name="class.name"> to identify the name of the post-function (look at the end of the line). - Ignore and find the next instance of the search if it is either of the following:
<arg name="class.name">com.innovalog.jmwe.plugins.functions.CreateIssueFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.EmailIssueFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.LinkIssuesFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.UnlinkIssuesFunction</arg>
If not, write down the name of the post-function looking at the class name Post-function Name | Transition Name | Workflow Name |
---|
Comment linked issues |
|
|
Work your way up on the file from the line that contains <arg name="valueType">template</arg> to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag. Write down the transition name in the table. Post-function Name | Transition Name | Workflow Name |
---|
Comment linked issues | Create |
|
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. Write down the workflow name. Post-function Name | Transition Name | Workflow Name |
---|
Comment linked issues | Create | Cash inflow |
Find the next instance of the search Repeat steps b to j until you reach the end of the file. Now you will have a list of transitions and their corresponding workflow name with post-functions that have a Groovy template. Workflow Name | List of transitions | Post-functions with Conditional script |
---|
Cash Inflow | Create | Comment linked issues | Done | Set field value of linked issues | Employee salary cycle | Reject | Comment issue | Approve | Comment issue |
- Identify post-functions with
Groovy expression as the Value type - Search for the text
<arg name="valueType">expression</arg> - Work your way up and look at
<arg name="class.name"> to identify the name of the post-function (look at the end of the line). - Ignore and find the next instance of the search if it is either of the following:
<arg name="class.name">com.innovalog.jmwe.plugins.functions.CreateIssueFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.EmailIssueFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.LinkIssuesFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.UnlinkIssuesFunction</arg>
If not, write down the name of the post-function looking at the class name Post-function name | Transition name | Workflow Name |
---|
Set field value |
|
|
Work your way up on the file from the line that contains <arg name="valueType">expression</arg> to find the name of the transition on which the post-function is configured. You can identify it under the <actions> tag. Write down the transition name in the table. Post-function name | Transition Name | Workflow Name |
---|
Set field value | To Do |
|
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. Write down the workflow name. Post-function name | Transition Name | Workflow Name |
---|
Set field value | To Do | PKP flow |
Find the next instance of the search Repeat steps b to j until you reach the end of the file. Now you will have a list of transitions and their corresponding workflow name with post-functions that have a Groovy expression. Workflow Name | List of transitions | Post-function name |
---|
SFVFUP TPI | To Do | Set field value | Done | Set field value |
Identify post-functions with Run as specific user- Search for the text -
<arg name="runAsUser"> - Proceed to the next step if the argument has a value, similar to this:
<arg name="runAsUser">djohn</arg>. If not find the next instance of the search. - Work your way up and look at
<arg name="class.name"> . Identify the name of the post-function looking at the class name under the same function element. - Ignore and find the next instance of the search if it is either of the following:
<arg name="class.name">com.innovalog.jmwe.plugins.functions.CreateIssueFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.EmailIssueFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.LinkIssuesFunction</arg> <arg name="class.name">com.innovalog.jmwe.plugins.functions.UnlinkIssuesFunction</arg>
If not write down the name of the post-function looking at the class name Post-function name | Transition Name | Workflow Name |
---|
Transition linked issues |
|
|
work your way up on the file from the line that contains <arg name="runAsUser"> to find the name of the transition on which the validator is configured. You can identify it under the <actions> tag. Write down the transition name in the table. Post-function name | Transition Name | Workflow Name |
---|
Transition linked issues | Done |
|
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. Write down the workflow name. Post-function name | Transition Name | Workflow Name |
---|
Transition linked issues | Done | SFVFUP |
Find the next instance of the search Repeat steps 2 to 10 until you reach the end of the file. Now you will have a list of transitions and their corresponding workflow name with post-functions that are run as a specific user. Workflow Name | List of transitions | Post-function name |
---|
SFVFUP | Done | Transition linked issues | Start Progress, Reject | Comment issue |
Now prepare a single table sorting it based on the Workflow name, Transition name. Add the count if a transition has a post-function more than once, as shown in the table Workflow Name | Transition name | Post-function name | Fix |
---|
SFVFUP | Start Progress | Transition linked issues, Set field value | Conditional execution |
| Start Progress | Comment issue | Groovy template |
| Done | Transition linked issues | Run As | Cash Inflow | Create | Comment linked issues(2) | Conditional execution |
| Create | Comment linked issues | Groovy expression |
| Done | Set field value of linked issues | Groovy expression |
Step 5 6 - Import the backup into your JIRA Cloud instance- Re-zip the extracted files.
- In Windows: Select all the extracted files and re-zip them using any tool, say 7z or
- In Linux: Navigate to the directory where the files are that you want to zip. Then type:
zip newbackup file1 file2 file3 - In Mac: Navigate to the directory where the files are that you want to zip. Then type:
zip -r backup.zip newbackup.zip
- Log in to JIRA Cloud as an administrator.
- Import the backup into your JIRA Cloud instance using Jira Import Wizard in Import and Export section.
Step 6 7 - Install the JMWE add-onSee here to know how to install the JMWE add-on Step 7 8 - Fix your workflowsIn this step you will do the remaining fixes: - Recreating the workflow extension and deleting the existing ones or
- Edit the workflow extension and modify it.
Recreate the workflow extensions in Jira Cloud- Refer to the table prepared in Step 34
- For each affected workflow listed in the table, open the workflow in an edit mode in the Cloud and Server.
- For each affected transition listed of the workflow, go to that transition in the editor and then to the Post-functions tab.
- Locate the post-function in JIRA Cloud. You can easily identify JMWE post-functions imported from Server because they appear strange with the Class:
com.innovalog.jmwe.plugins.functions.UnlinkIssuesFunction similar to this: Image Modified - Identify the name of the post-function looking at the class name (look at the end of the line).
- Locate the same post-function in JIRA Server by its position in the list and edit it to see its full configuration.
- Recreate the post-function:
- Click on
Add post-function in JIRA Cloud. - Recreate the post-function looking at its equivalent configuration in JIRA Server.
- Move the post-function right before the existing post-function
- Delete the existing post-function in JIRA Cloud.
- Once all the transitions in a workflow are fixed, publish the workflow.
Modify the workflow extensions in Jira Cloud- Refer to the table prepared in Step 45
- For each affected workflow listed in the table, open the workflow in an edit mode in the Cloud and Server.
- For each affected transition listed for the workflow, go to that transition in the editor and then to the Post-functions tab.
- For each post-function listed in the table locate the Post-function in JIRA Cloud looking at the same post-function in JIRA Server by its position in the list.
- Edit the post-function. If the fix is for
- A Conditional execution/Groovy expression/Groovy template, look at the script in the Server and write a Nunjucks template that is equivalent to the existing one. Save the post-function.
- The Run as specific user, look at the selected user in the Server and select the same in the Cloud. Save the post-function.
- Once all the transitions in a workflow are fixed, publish the workflow.
|