Documentation

Support

Unity Version Control

Attributes

Find attributes using the cm find command in Unity Version Control CLI.
Read time 1 minuteLast updated 21 days ago

Find and filter objects by the value of object attributes.

Filtering options

The following list displays the different filtering options (
where
) that are available to use with the
cm find attribute
command:
  • comment
  • date
  • guid
  • id
  • owner
  • srcobj
  • type
  • value

Output options

The following list displays the different output options (
--format
) available to use with the
cm find attribute
command:
  • comment
  • date
  • id
  • owner
  • type
  • value

cm find attribute
examples

Get 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
status
and the attribute value is
PASSED
.
You 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