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

Set ReadOnly on required field display error message if you do not leave the field before hitting enter

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Done
    • Affects Version/s: 6.11.0
    • Fix Version/s: 6.18.0
    • Component/s: Behaviours
    • Labels:
    • Sprint:
      SR4J Sprint 90, SR4J Sprint 91
    • Critical Points:
      3.1

      Description

      While the select list field was set as a required field and setReadonly in Behaviour, there's an error message appears while you do not leave the Text field before hitting enter.

      Steps to Reproduce

      There are two fields: A select list field and a text field.
      Only the select list field was set as a required field on field configuration.
      In Behaviour, the Select list field is set as a readOnly field on the Edit screen only. If we selected the “A” value of the Select list field on the create screen, the text field would set the required field on each screen. 

      1. Create a new select list field and a new text field.
      2. Only the select list field was set as a required field on field configuration.
      3. Set up Behaviour configuration:
        //Here’s the script of select list field:
        def field = getFieldById(getFieldChanged());
        if(getActionName() == "Create"){
           field.setReadOnly(false);
        }else{
            field.setReadOnly(true);
        }
        
        
        //Here’s the script of text field:
        def field = getFieldById(getFieldChanged());
        def selectListField = getFieldById("customfield_10200");
        if(selectListField.getValue() == "A"){
            field.setRequired(true);
        }else if (selectListField.getValue() == "B"){
            field.setRequired(false);
        }else{
           //no
        }
        
      4. Create a new issue > select "A" for Select list field > Fill in the Text field
      5. Edit the issue > edit the value in the Text field
      6. While the Text field is still in focus element state (do not leave the Text field) > hit Enter key

      Expected Behaviour

      The text field's value will be updated after hit the Enter key without an error message.

      Actual behavior

      Jira displaying an error message and the text field's value is not updated.

      Workaround

      1. If you click outside the text field after making a change and then hit enter it works
      2. After making a change on the text field, press update it works.

      Additional information

      The video showing how it can be reproed by Clarkie:
      https://drive.google.com/file/d/1fJcfyn7QxWh-Dks4rCrVzvcX8wQNxFK-/view

        Attachments

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            tlihyao Tiong Yao
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: