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

Behaviour: Server side script does not set form value if there is a Jira validation error in form

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 5.1.6
    • Fix Version/s: 5.3.5
    • Component/s: Behaviours
    • Labels:
      None
    • Critical Points:
      0.7

      Description

      1. Create a behaviour for a Single Select
      2. In server side script change value of another single select component based on the value of the single select bounded by the behaviour.
      3. When edit an issue do not provide value for a mandatory filed and select "update" button. This should cause JIRA validation error.
      4. Now changing the single select won't change value for the other select component as expected.

      Script sample code :

      import com.onresolve.jira.groovy.user.FieldBehaviours
      import groovy.transform.BaseScript
      
      @BaseScript FieldBehaviours fieldBehaviours
      
      def fieldA = getFieldByName("SelectListA")
      def fieldB = getFieldByName("SelectListB")
      def desc = getFieldById("description")
      
      def value = fieldA.getValue() as String
      
      if (value == "AAA") {
          desc.setFormValue("hello world")
          fieldB.setFormValue("10026")
      } else if (value == "BBB") {
          fieldB.setFormValue("10027")
      } else if (value == "CCC") {
          fieldB.setFormValue("10028")
      } else {
          fieldB.setFormValue("10029")
      }
      
      log.debug "************** done ***********************"
      

      Additionally, other actions won't work either following a failed submit.

        Attachments

        1. sampleImage.png
          43 kB
          Ashraful Hasan [X]

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            ahasan Ashraful Hasan [X] (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: