How to exclude from a list if a certain roleID is involved | Community
Skip to main content
MichaelSMN
Level 3
November 19, 2024
Solved

How to exclude from a list if a certain roleID is involved

  • November 19, 2024
  • 2 replies
  • 1218 views

I am looking at a list of projects and we need to exclude any that might have certain roles (e.g. "Email Role", or "Creative Role").    I am needing to create multiple views to allow teams to stack filters to identify which projects do not contain these specific compounded roles; results of projects would be any that included any number of different roles, just not the ones that were wanting to be excluded.  

 

Sample:  I want to create a view that does not bring these 2 projects in if they include this "web" team (and ultimately ability to stack to not include if specific teams are selected)

 

 

 

I tried to add a view where the project roleIDs does not equal and this only works if the only role in a project was for this web team.

 

 

I tried using text mode by adjusting the logic to something like the following where I was trying to show the list of projects if where this specific roleID(s) are not listed and had the same results where it only excluded if the roleID was exactly just that one role.

 

roleIDs=12f34567892f14547efbf73aa2fa4bef
roleIDs_Mod=cinotcontains

 

 

Any ideas? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sven-iX

Hi @michaelsmn 

I can confirm what you describe. If e.g. ONLY  "Email Role" is on the project the filter works. If there are multiple roles it doesn't.

I tried cinotcontains (string match) as well as cinotin (array match) 

I've not seen "in" or "notin" work on the API - I think this is a bug . Did you create a ticket? 

2 replies

Sven-iX
Community Advisor
Sven-iXCommunity AdvisorAccepted solution
Community Advisor
November 20, 2024

Hi @michaelsmn 

I can confirm what you describe. If e.g. ONLY  "Email Role" is on the project the filter works. If there are multiple roles it doesn't.

I tried cinotcontains (string match) as well as cinotin (array match) 

I've not seen "in" or "notin" work on the API - I think this is a bug . Did you create a ticket? 

skyehansen
Community Advisor
November 20, 2024

I'm a bit curious about your screenshot and your icon there. I can see you're in a "collection" and don't know what that means since there are at least 2 meanings for that word (I guess now there are three). Can you tell me a bit more about where you are?

 

Also, the way my brain interprets this sort of thing -- not to say that this is right or anything but -- the filter is looking at every single role ID in the project. And as long as one of them is not equal to your specific role ID, it's going to pull in that project. So that's why the filter only works if there's only 1 role ID on the project. All that to say I think this is sadly working as intended.

 

Normally I would suggest an exists filter (this is literally what they exist for), but in this case I can't see a connection between roles and projects. So nothing immediately springs to mind.

Sven-iX
Community Advisor
Community Advisor
November 20, 2024

Hi @skyehansen 

"roles" is a collection on the project and is an array of roleIDs found on the project tasks.

Per documentation "in" applies to arrays, so "notin" should, in my mind, mean "the collection of role IDs does not include ..." 

 

skyehansen
Community Advisor
November 20, 2024

like I said: not that it’s correct, but that’s how my brain pictures what is happening. I can’t tell you anything about how arrays work or what workfront does with them, but in my mind, this is no different from querying a bunch of tasks, issues, or files in a project. You can’t query something that isn’t there because it’s a collection and <insert whatever reason works for your brain here>.

 

If you want a simpler solution, you should query for all the roles that ARE there and just leave out the 2 you don’t want. (This could be easily done by putting the same keyword into the description of all the “right” roles and leaving the keyword off the “wrong” roles)