A Scottish court has deemed approvals for the Rosebank and Jackdaw fields unlawful, requiring reassessment of their environmental impacts.