Filter jobs by certain criterion

Hi. Have a project integrated with gitlab - a large and comprehensive script.
It triggers a job by the predefined variable in .yml file, as is:
rules:
-if : '$CI_COMMIT_TAG =~ /^release-.*/'

My question is how can I filter or count jobs which are generated with this trigger matcher?
Can it be done with gitlab api? Then how?

Thanks for answers or hints.

If that is your only rule for that job, then I believe that job should only ever run if that variable is matched.

If that is the case, then you should be able to do a query of listing project jobs (using pagination) and using shell (or i highly recommend using this gitlab python sdk) to find all of the jobs that match that specific name.