How to get a list of the Workflow Triggers and Properties in Jira to migrate to Cloud (JCMA)
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
JCMA + Workflow Triggers and Properties
- The JCMA plugin does not migrate Workflow Triggers and Properties. This is outlined at What gets migrated with the Jira Cloud Migration Assistant.
Environment
Jira Server / Data Center
Diagnosis
When a Workflow is created:
- Its XML data are stored in column descriptor of table jiraworkflows, together with the workflow name and id;
- Its Diagram is stored in table propertytext, referred to by column property_key of table propertyentry, however doesn't signify which Workflow it is in an easy way.
Cause
- Workflow Triggers and Properties are nested in the status and transitions within the workflow, due to this, it's not easy to retrieve this information directly from a value in the Database.
Solution
PART 1: Extract the XML content from the Workflow(s)
The SQL queries below will retrieve the workflows in the instance.
- This SQL query will provide all the workflows that exists in your instance separated per Project
- Extract/copy all the XML content inside the column "workflow_descriptor" for each of the workflows and paste it in a text editor.
SELECT p.id AS project_id, p.pname AS project_name, p.lead AS project_lead, ws.name AS project_associated_workflow_scheme,
wse.workflow AS workflow_scheme_associated_workflow, jw.descriptor AS workflow_descriptor
FROM project p LEFT OUTER JOIN nodeassociation na ON na.source_node_id = p.id AND na.sink_node_entity = 'WorkflowScheme'
LEFT OUTER JOIN workflowscheme ws ON ws.id = na.sink_node_id
LEFT OUTER JOIN workflowschemeentity wse ON wse.scheme = ws.id
LEFT OUTER JOIN jiraworkflows jw ON jw.workflowname = wse.workflow
- This SQL query will provide all the workflows by Project. Replace the <project_name> with the Project Name.
- Extract/copy all the XML content inside the column "workflow_descriptor" for each of the workflows and paste it in a text editor.
SELECT p.id AS project_id, p.pname AS project_name, p.lead AS project_lead, ws.name AS project_associated_workflow_scheme,
wse.workflow AS workflow_scheme_associated_workflow, jw.descriptor AS workflow_descriptor
FROM project p LEFT OUTER JOIN nodeassociation na ON na.source_node_id = p.id AND na.sink_node_entity = 'WorkflowScheme'
LEFT OUTER JOIN workflowscheme ws ON ws.id = na.sink_node_id
LEFT OUTER JOIN workflowschemeentity wse ON wse.scheme = ws.id
LEFT OUTER JOIN jiraworkflows jw ON jw.workflowname = wse.workflow
WHERE p.pname = '<project_name>';
From JIRA UI, you can export each Workflow in the instance:
- Go to Administration > Issues > Workflows > Click Edit > Click Export Button > As XML
- Open the XML file in a text editor
PART 2: Find the Triggers and Properties in the XML content
Find all the values inside the <meta name lines for each of the transitions and statuses. For example below:
For the status Awaiting CAB approval we can see all the properties, the meta name is the property key and the value inside it, is the property value
<step id="3" name="Awaiting CAB approval">
<meta name="approval.transition.approved">31</meta>
<meta name="jira.status.id">10107</meta>
<meta name="approval.transition.rejected">121</meta>
<meta name="approval.condition.type">number</meta>
<meta name="approval.condition.value">1</meta>
<meta name="approval.active">false</meta>
<meta name="approval.field.id">customfield_10500</meta
For the transition Ready for CAB approval we can see all the properties, the meta name is the property key and the value inside it, is the property value
<action id="161" name="Ready for CAB approval" view="fieldscreen">
<meta name="sd.resolution.clear"></meta>
<meta name="opsbar-sequence">10</meta>
<meta name="jira.description"></meta>
<meta name="jira.i18n.description"></meta>
<meta name="jira.fieldscreen.id">10215</meta>
And everything inside the <post-functions> are the triggers for a standard post-function. Example below:
<post-functions>
<function type="class">
<arg name="class.name">com.atlassian.jira.workflow.function.issue.UpdateIssueStatusFunction</arg>
</function>
<function type="class">
<arg name="class.name">com.atlassian.jira.workflow.function.misc.CreateCommentFunction</arg>
</function>
<function type="class">
<arg name="class.name">com.atlassian.jira.workflow.function.issue.GenerateChangeHistoryFunction</arg>
</function>
<function type="class">
<arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueReindexFunction</arg>
</function>
<function type="class">
<arg name="eventTypeId">13</arg>
<arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg>
</function>
</post-functions>