How to delete pipelines when removing a branch in gitlab?

Hello, is there a way to delete pipelines of certain branch when removing the branch in gitlab?

As I know there is API but using it I can remove only one by one.


But it’s not convenient. Maybe there is another way to automate deleting?