Using XML to create a workflow

Jira's workflow editor generates OSWorkflow XML definition files that are stored in Jira's database. If you need to take advantage of an OSWorkflow-based feature that is not available in Jira's workflow editor, you can define the workflow in XML and then import it into Jira as described below.

Once the XML workflow has been imported, Jira's workflow editor should be able to display most OSWorkflow definitions, even if it does not support creating or editing them.

For example, conditional results of workflow transitions are displayed in the Other tab on the View Workflow Transition page.

(info) The Other tab is only visible if a transition has elements that the editor does not directly support.

Importing an XML workflow into Jira

  1. Log in as a user with the Jira System Administrators global permission.
  2. Choose Administration () > Issues. Select Workflows to open the Workflows page, which displays all of the workflows in your system.
  3. Click the Import from XML button to open the Import Workflow dialog box.
  4. In the Name field, type a name (usually 2-3 words) to identify your new workflow.
  5. (Optional) In the Description field, type a detailed description of your new workflow.
  6. For the Workflow Definition  option, you can do either of the following:
    • Upload an XML workflow definition file — to do this, choose the Provide a full path to an XML file... option, and in the File Path field, type the full path to your XML workflow definition file.
      (warning) This path must be local one, so your XML workflow definition file must be located on your Jira server.
    • Paste the contents of an XML workflow definition file into Jira — to do this, choose the Paste the workflow XML definition option, copy the contents of your XML workflow definition file, and in the Workflow Definition (XML) field, paste this copied content.
  7. Click the Import button.

Copying a workflow between systems

Sometimes, it is useful to create a workflow in a test system and then copy it into a production system. To do this:

  1. In the test system, export the workflow to XML by clicking the XML link next to the workflow in the list shown on the View Workflows page and save the output into a file.
  2. In the production system, import the file via the 'import a workflow from XML' link as described above.

(minus) When importing an XML workflow into Jira:

  • Jira's XML workflow definitions contain references to Jira meta attributes. For example, the id of the linked Jira status of each workflow step is stored as a 'Jira.status.id' meta attribute in the step's definition. Therefore, when manually creating workflows in XML, please ensure that all referenced external entities exist before you import the workflow into Jira.

(minus) When copying a workflow between systems:

  • Please note that conditions, validators and post functions can have parameters that might be valid in one system and not in another. For example, different systems might contain different sets of values for the 'Resolution' field. This would be a problem if the 'Update Issue Field' post function is used to set the 'Resolution' field to a value that exists in one system but not the other.
Last modified on Aug 26, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.