Sort jobs based on job id among individual group