Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-66515

Not able to search for Groups with Special Characters using REST API and from the UI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 7.5.0, 7.6.0
    • REST API

    Description

      Summary

      Users are able to search for Groups with Special Characters using REST API and UI. To reproduce it properly you the following 3 conditions must be met:

      1. You should have a group with such tricky symbols in the database.
      2. The last word in the group name must be the word with those symbols. For example it works fine for group SİSTEM group but fails for group named My SİSTEM
      3. For Jira 6.3.10, if you add the JVM parameter -Dsun.jnu.encoding=Cp1252 and your query contain the tricky symbols from the group name, for example ?query=SISTEM will work but ?query=SİSTEM will fail (note the difference between İ and I).

      In the logs we see errors like:

      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 23
      	at java.lang.String.substring(String.java:1963)
      	at com.atlassian.jira.util.DelimeterInserter.insert(DelimeterInserter.java:294)
      	at com.atlassian.jira.rest.v2.issue.groups.GroupPickerResourceHelperImpl.buildMatchingHtml(GroupPickerResourceHelperImpl.java:146)
      	at com.atlassian.jira.rest.v2.issue.groups.GroupPickerResourceHelperImpl.limitGroupResults(GroupPickerResourceHelperImpl.java:107)
      	at com.atlassian.jira.rest.v2.issue.groups.GroupPickerResourceHelperImpl.findGroupsAsBean(GroupPickerResourceHelperImpl.java:93)
      	... 235 more
      

      Environment

      Jira 7.5.0

      Steps to Reproduce

      Scenario 1: REST API
      1. Create a group SİSTEM and the following query fails all the time
        <BASE_URL>/rest/api/2/groups/picker?query=SİSTEM
        
      Scenario 2: UI
      1. Create a group SİSTEM
      2. Go to Users and roles page in any project
      3. Select Add users to a role
      4. Search for SİSTEM
      5. You will get the error:
        The JIRA server was contacted but has returned an error response. We are unsure of the result of this operation.
        

      Workaround

      Modify the group names to add regular words at the end of the group name (e.g. 'group' word)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mriza Mohamed Riza (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: