Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-6325

Entering an ampersand (&) in a workflow transition description breaks the workflow

    XMLWordPrintable

Details

    Description

      If an '&' is entered into a workflow transition description, JIRA breaks with an error:

      com.atlassian.jira.workflow.WorkflowException: com.opensymphony.workflow.InvalidWorkflowDescriptorException: org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
      
      com.atlassian.jira.workflow.WorkflowException: com.opensymphony.workflow.InvalidWorkflowDescriptorException: org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.
      	at com.atlassian.jira.workflow.OSWorkflowManager.createWorkflow(OSWorkflowManager.java:264)
      	at com.atlassian.jira.workflow.OSWorkflowManager.saveWorkflow(OSWorkflowManager.java:270)
      	at com.atlassian.jira.workflow.ConfigurableJiraWorkflow.store(ConfigurableJiraWorkflow.java:69)
      	at com.atlassian.jira.web.action.admin.workflow.AddWorkflowTransition.doExecute(AddWorkflowTransition.java:107)
      	at webwork.action.ActionSupport.execute(ActionSupport.java:153)
      	at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:58)
      	at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:132)
      	at com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:185)
      ...
      

      (stacktrace from 3.6.2).

      However, the description is stored in the workflow, and isn't properly escaped (&). This means that when the workflow XML is requested, it is invalid. Firefox and IE will complain if asked to render it:

      XML Parsing Error: not well-formed
      Location: http://localhost:8080/secure/admin/workflows/ViewWorkflowXml.jspa?workflowName=Copy+of+jira
      Line Number 287, Column 46:          <meta name="jira.description">foo & bar</meta>
      ---------------------------------------------^
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              keith@atlassian.com Keith Brophy
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.25h
                  0.25h