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

Behaviour to clear the value of a selection list field does not work in JSD portal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Done
    • 6.10.0
    • 6.12.0
    • None
    • SR4J Sprint 87
    • 1

    Description

      Issue:

      When mapping a behaviour to a Service Desk project, using .setFormValue(null) on a single select list does not perform as expected

      Steps to reproduce:

      Create a single select custom field (Field A) with 2 options, 'Yes' and 'No'
      Create a second single select custom field (Field B) with any number of random options
      Configure a Service Desk Ticket screen to include these fields
      Create a Behaviour that is mapped to the Service Desk Project using Service Desk mapping, and apply the code below
      Go to create a ticket, select a value in Field B, and then select 'No' in Field A

      Expected result:

      Value in Field B should be cleared

      Actual result:

      Value in Field B is no cleared

      Code used:

      Behaviour applied to Field A

      def SelectionListField = getFieldByName("Field B")
      def YesNoField = getFieldById(getFieldChanged())
      
      def selectedOption = YesNoField.getValue() as String
      def isYesSelected = selectedOption == "Yes"
      
      if (!isYesSelected)
      
      { SelectionListField.setFormValue(null) }
      

       

      Attachments

        Activity

          People

            jechlin Jamie Echlin
            rbailey Bobby Bailey
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: