Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!
SOLVED

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

Avatar

Level 2

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)

 

MichaelSMN_3-1732049731713.png

 

 

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.

MichaelSMN_2-1732049605450.png

 

 

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? 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 6

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? 

View solution in original post

7 Replies

Avatar

Correct answer by
Level 6

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? 

Avatar

Community Advisor

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.

Avatar

Level 6

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 ..." 

 

Avatar

Community Advisor

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)

Avatar

Level 6

Hi @skyehansen 
Per APIexplorer there is a linking object "ProjectUserRole" (PTEAM) that has projectID and roleID attributes, but I'm failing to make an EXISTS filter work - what am I doing wrong?

EXISTS:b:$$EXISTSMOD=NOTEXISTS
EXISTS:b:$$OBJCODE=PTEAM
EXISTS:b:projectID=FIELD:ID
EXISTS:b:roleID=64d51cce0134c70601deab0acf5b8ce0

 

Avatar

Community Advisor

the PTEAM are the users in the People tab. As soon as you assign someone in that role, your filter will work.

Avatar

Level 2

The scenario we are looking for is prior to any user assignment, we need to find projects that do not contain certain types of roles on that project.   We are using this as a marketing prioritization process which essentially allows teams to pick up the backlog of projects and find the next most valuable project to begin as long as the project does not include teams that would not have real time capacity to start work. 

 

The view I was creating was on a project list view within the collection and looking for a solution for appropriately filtering out projects that had certain roles that were assigned as part of the template.