Hey,I just did this tutorial about adding a custom CQL field to Confluence: https://developer.atlassian.com/server/confluence/adding-a-field-to-cql/
That’s no problem, but how the hell do I put values in custom CQL fields?There is nothing written in the tutorial that would help and I can’t see any option to put values in those field in the Confluence backend.
I don’t think this is a hard question… But I can't fiend any answer...
Hello Hauke,
Thanks for providing the reference to where you’re working with for the tutorial. From reviewing the tutorial there is a section which breaks down the CQL requirements to be used within a field. This is within Step 2 and is listed like the following example:
To add a field, we need to add the following to atlassian-plugin.xml file:
<cql-query-field fieldName="status" key="status-field" name="Content Status Field" class="com.example.plugins.tutorial.confluence.impl.StatusFieldHandler"> <ui-support value-type="string" default-operator="=" i18n-key="cql.field.status" data-uri="/rest/status-field/status-values"/></cql-query-field>
The cql-query-field declaration is what defines a new CQL field.
Attribute
Purpose
fieldName
Name of the field that will be used in CQL statements.
key
Unique ID of this CQL field declaration in the plugin.
name
A human readable name for the field.
class
The implementation of the CQL field. This should extend the
com.atlassian.querylang.fields.BaseFieldHandler class
This information points to where the CQL will be included along with the name/fields to be used for the options. The above was provided from Adding a field to CQL.
I hope this example helps and guides you in progressing through the tutorial.
Regards,
Stephen Sifers
Thank you for your answer, but unfortunately that wasn't my problem. I finished the tutorial and everything is working fine, I have the status field in my advanced search view.
But I don't understand how to use this new field. I thought I could put information into it for each page I have, to stay in the tutorial context, one page I give the info X for my newly created "status" field, and one gets Y and I could filter for those values in advanced search.
So if I would filter in a CQL search for value Y in "status" field, I would only get pages with "status" field information Y as search result.
But that's not how it works? Or how could I put those X or Y-information in my "status" fields for each page I have?
To understand more about what you're wanting to do via CQL I will need to see an example. Could you please provide an example of a CQL statement you're attempting to use?
This will help us to review and understand where you're having issues with your CQL statement.
Regards,Stephen Sifers
Hi,
thanks for your answer.
I want to have some searchable fields on each page, where I can put information in.
Because I want to filter my search results by that information in those searchable fields I added.
Now I'm saving some extra information for each page with the contentPropertyManager, but that's not searchable.
So I thought searchable CQL fields just sound like what I'm searching for, but I don't get it how they work.
It looks like you're new here. Sign in or register to get started.