Skip to main content
Jan 12, 2018 7:54 AM UTC
Solved

How to find all projects with attributes?

Hi,

we would like to find all projects with (certain) attributes.

 

We can find find all members with certain attributes via

si viewproject --fields=memberarchive,attributes --filter=attribute:<attrname>

but unfortunately, this does not work on project attributes.

 

We can list a project (with its attributes) via

si projectinfo --attributes

but projectinfo has no --fields and no --filter parameter and does not work recursive (for subprojects), so there is always only one project listed.

 

This is even more important for projects than for members because member attributes can be shown in columns, but project attributes always have to be selected for a single project via project information. This makes it really hard to locate project attributes for many projects.

kthiererAnswer
Feb 9, 2018 10:55 AM UTC

If you have a filter that matches no member then only the subprojects are printed.

This example would fail to print only subprojects if there really was a member named

"NONEXISTENTMEMBERNAME " within the project (tree).

So "NONEXISTENTMEMBERNAME" is just placeholder for a file filter that never matches.

6 replies

ssaulAuthor
Feb 9, 2018 7:52 AM UTC

In the meantime, we contacted PTC support who told us that this is actually not possible.

So I added an idea:

https://community.ptc.com/t5/Integrity-Ideas/Find-all-projects-with-certain-attributes/idi-p/500766#M1050

Feb 9, 2018 10:01 AM UTC

Well at least there is a tricky way to generate a somehow parseable subprojects list, which could be processed further with 'si projectinfo -S ....' commands.

 

D:\PtcTest>si viewproject --recurse --fields=name --filter=file:NONEXISTENTMEMBERNAME > subprojects.txt

 

Regards Juergen

ssaulAuthor
Feb 9, 2018 10:30 AM UTC

Thanks for the hint - I did'nt know about the NONEXISTENTMEMBERNAME file filter to get the project.pj before.

Is this documented somewhere?

Does this work for newer Integrity versions (without sandbox project.pj files), too?

 

Anyhow, this might be a solution although it requires a lot of scripting.