JQL Search for Customfields

Hi @hier,

I can’t get the JQL search working for a newly defined customfield. Here is the relevant manifest part:

      type: object
      formatter:
        expression: "`${value.myNumber}`"
        schema:
          properties:
            myNumber:
              type: number
          required: ["myNumber"]

Whenever I attempt to search for the field using a jql expression the number operators are not available. An attempt to use such an operator results into:

The operator ‘>’ is not supported by the ‘myNumberField’ field.

What am I doing wrong?

Hey @a.yessipovskiy,

You need to define a search alias for your property, like this:

      type: object
      formatter:
        expression: "`${value.myNumber}`"
        schema:
          properties:
            myNumber:
              type: number
              searchAlias: myNumber
          required: ["myNumber"]

Then you’ll be able to use number operators, e.g.: MyFieldName.myNumber > x.

Hey @kkercz
thank you for the prompt reply. Now I know where my error was, I’ve misinterpreted the “searchAlias” concept. Now the relevant operators are available, unfortunately I get the error, which I cannot relate as a result:

‘2_cf_number.myNumber’ does not exist or you do not have permission to view it.

Is there an extra configuration required to get the “object” customfield working within jql?

I know it does not have to do directly with the initial question, but could you give me a hint? I am using the standard workflow and got admin rights on the instance.

1 Like

So you’re saying that you get your field in autocomplete and all but the search itself doesn’t work with that message when you execute the query? That’s unexpected. Could you create a bug in the Forge Jira project?

This is correct, I get the field in autocomplete (provide the attribute “myNumber” manually) and using autocomplete I am able to select the relevant operator. After submitting the query I receive the above stated error message. Thank you.

For those of you wondering what could be wrong here is the fix.
Make sure all tabs are on place and reformat your manifest to assure the correct indentation of all elements. The linter which validates the manifest does not catch all issues.

1 Like