Sorting changes the order of rows. Select every column that belongs to the records before sorting, even if you care about only one column. Sorting Priority alone would detach priorities from their job IDs and leave a believable but wrong sheet.
Open Data > Sort range > Advanced range sorting options. If the selection includes the headings, check Data has header row. The dropdowns then use column names, and the heading stays at the top. If you select only data rows, leave that box unchecked.
Add another sort column to decide ties. Team A to Z, then Priority A to Z groups each team's jobs and puts priority 1 first inside each group. A third rule makes the order predictable when both fields tie. A blank Hours cell means the estimate is missing; it isn't the same as a measured zero.