Sort issues and merge requests in ascending and descending order Closes #39849 See merge request gitlab-org/gitlab-ce!21438