Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

User Macro: Search for multiple labels

[denkwerk] Marcel Nürnberger January 18, 2018

Hi everyone! Within my macro (contentbylabel), I want to search for content with multiple labels. They should not only have a one specific, but two specific labels. Right now, adding another "AND" to the syntax does not work.

Does anyone have a clue how to solve this problem?

Thanks in advance!
Marcel

<ac:macro ac:name="expand">
<ac:default-parameter>$title</ac:default-parameter>
<ac:rich-text-body>
<ac:structured-macro ac:name="contentbylabel" ac:schema-version="2">
<ac:parameter ac:name="showLabels">false</ac:parameter>
<ac:parameter ac:name="cql">label = "$topic"</ac:parameter>
</ac:structured-macro>
</ac:rich-text-body>
</ac:macro>

1 answer

1 accepted

1 vote
Answer accepted
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 19, 2018

Hi Marcel,

I think the syntax for your CQL would be "label = <label1> AND label = <label2>". If you want to include multiple labels, you could have the parameter be a comma separated list, and then you could split based on the comma and do a foreach loop where you do string + "AND label = " + label, and then use a substring to remove the first AND from the string.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events