Skip to main content
15-Moonstone
January 12, 2018
Solved

How to find all projects with attributes?

  • January 12, 2018
  • 1 reply
  • 4402 views

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.

Best answer by kthierer

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.

1 reply

ssaul15-MoonstoneAuthor
15-Moonstone
February 9, 2018

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

12-Amethyst
February 9, 2018

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

ssaul15-MoonstoneAuthor
15-Moonstone
February 9, 2018

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.