Jira entity property - indexing an issue property that is a number not working

Hello,
I’m having issues making an issue entity property searchable in JQL when its value is just a number. I am using the Forge module jira:entityProperty to try and make this happen.
I believe this is similar to a previous issue here: Help making issue properties searchable


When I set the entity property value to an object I am able to search for properties in that object, e.g.

Setting property my-property to:

{
    "value": 91874
}

Allows me to search JQL: issue.property['my-property'].value = 91874 or myPropertyAlias = 91874

With the following entityProperty module in my Forge app:

jira:entityProperty:
 - key: my-issue-property
   entityType: issue
   propertyKey: my-property
   values:
     path: value
     type: number
     searchAlias: myPropertyAlias

However, if I just set the entity property to a number:

91874

And I can’t find a way to have the property indexed as when I add a path to the values in the Forge module, it is no longer looking at just my-property key for the value, and using JQL issue.property['my-property'] doesn’t return any results.


The limitations according to https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/ just require that the property value be valid JSON (able to be read by JSON.parse), which a number value does qualify for.

I would change the property to an object rather than just a number but this is on an existing site where there are thousands of tickets with the property as a number, and lots of automations set up that create the property as a number.

Is there a way that I am missing that allows me to make the entity property searchable with JQL as it is?

Thanks for any help :slight_smile:

Hello @TomWray

Setting property my-property to: {"value": 91874}

When you declared the entity property without surrounding its value with double inverted commas, that made that value a number. AFAIK there was nothing else you needed to do.

The limitations according to [snip] just require that the property value be valid JSON (able to be read by JSON.parse), which a number value does qualify for.

When I used the JSON.parse() test tool, the first JSON statement, as shown at the top of this thread, is perfectly valid and I can get both the object and theobject.value, but if I just declare a JSON statement of “91874“, nothing else, then I can’t get the value, just the object, as expected, because the JSON statement is just declaring a numerical object with no value.

Without associating a value to an object, how would the JQL know what to look for? JQL searches for objects (In this case, an issue property) that have particular values, not plain objects.

1 Like

Thanks for the reply. That all makes sense. I assume there’s no way to have the entityProperty Forge module look at that object as a value itself then? So I’d need to convert existing entity properties from just the number to the object as in the first example?