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

JQL searches ignore custom fields contexts when sorting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.7.0, 7.13.1, 8.0.0
    • Custom fields, JQL
    • None

      Summary

      JQL searches ignore custom fields contexts when sorting. The only value taken in consideration is the option sequence number in the database.

      Steps to Reproduce

      1. Create two projects, called ONE and TWO.
      2. Create a custom field with type Select List (multiple choices) named Country.
      3. Add a context for each project (ONE and TWO) and add options to each context in the following way:
      4. Create issues on both projects, randomly assigning values of Country to each issue. The script below might help:
        #!/bin/bash
        USERNAME="admin"
        PASSWORD="admin"
        BASE_URL="http://localhost:8080"
        URL="$BASE_URL/rest/api/2/issue/"
        KEY="TWO"
        AMOUNT=25
        for i in $(seq $AMOUNT)
        do
          COUNTRY=$(shuf -n1 -e 'Malaysia' 'Indonesia' 'Hong Kong' 'China' 'Thailand')
          DATA="{ \"fields\": { \"project\": { \"key\": \"$KEY\" }, \"summary\": \"Task #$i\", \"description\": \"Task #$i \", \"customfield_10007\": [{ \"value\":\"$COUNTRY\" }], \"issuetype\": { \"name\": \"Task\" } } }"
          curl -u $USERNAME:$PASSWORD -X POST --data "$DATA" -H 'Content-Type: application/json' $URL
          echo
        done
        
      5. Run the following JQL query:
        issuetype = Task ORDER BY Country ASC
        

      Expected Results

      All issues are sorted by their value of Country, in alphabetical order.

      Actual Results

      Issues are displayed out of order in regard to to the field Country, like in the example below:

      Workaround

      None

        1. cf-contexts.png
          cf-contexts.png
          581 kB
        2. wrong-sorting-order.png
          wrong-sorting-order.png
          533 kB

              Unassigned Unassigned
              vfontes Vinicius Fontes
              Votes:
              5 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated: