Refactor task filtering to be more generic

[#79618146]
Add bbs.GetAllTasksByDomain

[#79618146]