Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-4173

"Send a custom email" workflow script configuration deserialisation incorrectly assumes that FIELD_EMAIL_FORMAT will be either HTML or TEXT

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • High
    • Resolution: Done
    • 5.7.0
    • 5.7.2
    • None
    • None
    • SR4J Sprint 73
    • 6.7

    Description

      It seems that it can also be an empty string as shown in this redacted snippet of workflow xml submitted in a support ticket by a customer:

      <function type="class">
        ...
        <arg name="FIELD_EMAIL_FORMAT"></arg>
        ...
      </function>
      

      Trying to deserialise config like this leads to:

      Script failure, check logs: Cannot deserialize value of type `com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.mail.EmailFormat` from String "": not one of the values accepted for Enum class: [HTML, TEXT] at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.SendCustomEmailCommand["FIELD_EMAIL_FORMAT"])
      Cannot deserialize value of type `com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.mail.EmailFormat` from String "": not one of the values accepted for Enum class: [HTML, TEXT]

      Attachments

        Activity

          People

            krana Kyran Rana [X] (Inactive)
            merdmann Marcin Erdmann [X] (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: