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

Behaviour to set Checkbox/Radio Buttons as Required field does not remove (optional) text and the None option

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • L3
    • Resolution: Fixed
    • 6.10.0
    • 6.15.0
    • Behaviours
    • None
    • SR4J Sprint 89
    • 4.7

    Description

      Behaviours mapped to the "Use Service Desk mapping" type on a RadioButton or CheckBox custom field still displays "optional" in the customer portal whenever calling setRequired(true) on those fields

      Steps to reproduce:

      1. Create a SD project
      2. Create a RadioButton or CheckBox custom field
      3. Add the field to the customer portal screen
      4. Create a Behaviour with the "Use Service Desk mapping" and mapped to "All request types"
      5. Click on the cogwheel on the Behaviour > Edit
      6. a. Click on 'Add Field' > select the RadioButton or CheckBox custom field > Add
        Then click on the 'Optional' toggle button to make it 'Required' > Save
      1. Go to the customer portal in the created SD project and notice the "(optional)" text  and the none option on the field which shouldn't be there as the field is set to required

      6. b. Alternatively,
      In the initialiser paste this code

       getFieldByName(FIELD_NAME).setRequired(true)  
      • Update by Lih Yao:
        This happened while using behavior on setlabel and setDescription on RadioButton as well.
        For example:
        getFieldByName("RadioButton").setDescription("abc")
        getFieldByName("RadioButton").setlabel("abc")
        

        I've done a few tests (only for setlabel() and setDescription()) on different versions:
        Working Version: Jira Service Desk: 3.16.8, Scriptrunner: 6.5.0
        Not working Version: Jira Service Desk: 4.13.1, Scriptrunner: 6.13.1
         

      Attachments

        Activity

          People

            dluksza Dariusz Luksza
            wkoh Winnie Koh
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: