Use FOREIGN_ID for task matching instead of PERMALINK