Sort by key does not work on rules/search

SQ 8.6.0; accessed through web_api using PowerShell 5.1.

> $params = @{languages = 'jsp'; s = 'key'}
> $response = Invoke-WebRequest -Uri $url -Header $headers -Body $params
> $returnPage = $($response.Content | ConvertFrom-Json)
> $returnPage.rules.Length
6

# So far so good, we got the 6 JSP rules...

> $returnPage.rules | %{$_.key}
common-jsp:InsufficientBranchCoverage
common-jsp:InsufficientLineCoverage
common-jsp:InsufficientCommentDensity
common-jsp:DuplicatedBlocks
common-jsp:SkippedUnitTests
common-jsp:FailedUnitTests

# So they are not sorted...

# Removing the s field from $params and calling again gets the same results.

# I checked the raw data in $response to make sure it was also unsorted and not just a bug in my JSON converter.

Hi @MisterPi ,

thanks for reporting this. we are already aware about this (SONAR-14325) and it will be fixed with the next version of sonarqube which will be released soon.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.