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

Bug in SetErrorText that leaves field in incorrect state

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 4.3.18
    • Fix Version/s: 5.0.11
    • Component/s: Behaviours
    • Labels:
      None
    • Sprint:
      Sprint 28 - Ends Apr 19, Sprint 29 - Ends 10 May, Sprint 30 - Ends June 20, Sprint 31 - Ends June 27
    • Critical Points:
      3.5

      Description

      From my investigation it has become apparent that setting or clearing an error on a field from the move issue screen causes issues.

      The setErrorText method blows up on the below line

      $('[data-jbhv="' + labelText + '"]').remove();
      

      If the behaviour script assigned to the field calls setError() or clearError(), this fires the setErrorText method in JS.

      The problem is the labelText that is got using the line

      var labelText = $("label[for='" + $field.attr('id') + "']").text();
      

      returns different things on the move issue screen than the create issue screen.

      "
      Component/s:
      "
      vs.

      "Component/s:"

      On move issue, the text has lots of whitespace, which JQuery doesn't seem to be able to handle gracefully, throwing an exception.

      Steps to reproduce

      1. Create a behaviour script that calls either setError or clearError and attach it to a field that will require an update on move (for example, components since they are unique to a project).
      2. Create an issue and try to move it to another project
      3. Watch the JS code blow up!

        Attachments

          Activity

            People

            Assignee:
            tbatagiannis Thanos Batagiannis
            Reporter:
            akandeel Ahmed Kandeel [X] (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: