Is combining filtering operators any and count possible?

Hi all,

My specific use case:
I want to create a monitoring, which alerts me if there are projects with more than one "Project Manager”.

For this i tried the following GET request to the awork api:
/api/v1/projects?filterby=members/any(m: m/projectRoleId eq guid’ROLE-PROJECT-MANAGER-GUID’) and members/count() gt 1

This returns all projects having at least one member with the role “Project Manager” and having more than one member.

Is it possible to combine any and count in a way, that only the already filtered members by the “any-part” are counted?

Thanks in advance and kind regards,
Nicola

Hi @Nicola ,

this does not work today - but one of the developers implemented that and it is gonna be released tonight or tomorrow. It will work like this: members/count(m: m/projectRoleId eq guid'ROLE-PROJECT-MANAGER-GUID') gt 1

I hope that helps!

Nils

Hi @Nils

Thank you very much for the fast reply and the even faster implementation! :grinning_face_with_smiling_eyes:
I was just able to test it, it works like a charm.

Cheers,
Nicola

1 „Gefällt mir“

great! Happy to help :slight_smile: