Attributes
Find attributes using the cm find command in Unity Version Control CLI.
Read time 1 minuteLast updated 9 months ago
Find and filter objects by the value of object attributes.
Filtering options
The following list displays the different filtering options () that are available to use with the command:
wherecm find attributecommentdateguididownersrcobjtypevalue
Output options
The following list displays the different output options () available to use with the command:
--formatcm find attributecommentdateidownertypevalue
cm find attribute
examples
cm find attributeGet all attributes
To find attributes, you need the object ID. For example, you can get the ID when you query for a branch:
cm find branch "where name = 'main'" --format="{id}" --nototal3
When you have the object ID, you can get the attribute list for that ID:
cm find attributes "where srcobj = 3" --nototalobjid:3@repid:2@repserver:localhost:8087 -- status --> PASSED
In the previous example, the attribute name is and the attribute value is .
statusPASSEDYou can use Powershell or Bash to combine the two commands:
- Powershell:
cm find branch "where name = 'main'" --format="{id}" --nototal |Foreach-Object { cm find attributes where srcobj= $_ --nototal}
- Bash:
for branch_id in 'cm find branch "where name = 'main'" --format="{id}" --nototal' ;do cm find attributes "where srcobj=$branch_id" --nototal; done
Get all objects with a specific attribute
Query for a specific attribute regardless of the type of object:
cm find attributes "where type = 'status' and value='PASSED' and date > 'this month'"objid:253012@repid:2@repserver:localhost:8087 -- status --> PASSEDobjid:253013@repid:2@repserver:localhost:8087 -- status --> PASSEDobjid:253014@repid:2@repserver:localhost:8087 -- status --> PASSEDobjid:268518@repid:2@repserver:localhost:8087 -- status --> PASSED