I suggest you ...

Support for more complex find queries

Specifically, I want to find all changesets with two attributes with specific values. Something like:
find changesets where attribute = 'Review status' is 'none' and attribute = 'Reviewer' is 'somebody'

36 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
JakubH shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

7 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...
  • Göran Wallgren commented  ·   ·  Flag as inappropriate

    UPDATE: It's possible to use the following syntax to check for an attribute-value, regardless of which attribute has that value:

    where attrvalue = 'some_name'

    It's also possible to combine these with OR to match one of several values:

    where attrvalue = 'some_name' or attrvalue = 'other_name'

    However, combining these with AND does not work to match two different values of two different attributes.

    Also, the following works as expected (note the use of OR between parantheses) :

    where (attribute = 'attr1' and attrvalue = 'some_name') or (attribute = 'attr2' and attrvalue = 'other_name')

    However, the following does not work as one would want (note the use of AND between parantheses) :

    where (attribute = 'attr1' and attrvalue = 'some_name') and (attribute = 'attr2' and attrvalue = 'other_name')

    The exact syntax and limitations of the cm find command remains a mystery... It is not very consistent, unfortunately.

  • Göran Wallgren commented  ·   ·  Flag as inappropriate

    UPDATE: The following command actually works (at least in 5.4.16.731) for finding all the branches that do NOT have the specific attribute "branch_status" applied (regardless of whether there are other attributes or not) :

    cm find branch where not attribute = 'branch_status'

    (Note the use of "not" instead of "!=" in this query...)

  • Göran Wallgren commented  ·   ·  Flag as inappropriate

    To filter the Branches view for branches that do NOT have a specific attribute for our "branch_status" attribute, I can use the following syntax:

    find branch where attribute="branch_status" and attrvalue != "completed"

    However, that will NOT include branches that don't have that attribute applied at all. It would be much more useful if there was a way to include these too in the same query.

    To find the branches that don't have the attribute applied, it would be logical to use the following syntax:

    find branch where attribute != "branch_status"

    That query works, but not as expected. It has a very counter-intuitive interpretation: [where (count attributes > 0) AND (attributes DO NOT CONTAIN 'branch_status')].

    Please consider changing the interpretation to simply: [where (attributes DO NOT CONTAIN 'branch_status')].

    Additionally, finding a branch by namespace is not possible. Even worse, [find branch where name = 'main'] returns 1 branch, but [find branch where name = '/main'] returns none! Please add full namespace support so we can find branches by complete name such as name = '/main/task001/subtask_1'.

    Also, I propose adding a "depth" or "level" filter-option for the branch find-object, to filter on branch namespace-depth (like "Display branch levels" in Branch Explorer).

Feedback and Knowledge Base