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

To import an XML workflow into JIRA:

  1. Log in as a user with the JIRA System Administrators global permission.
  2. Choose > 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.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport