Hello,
As a developer, I saved a property to an issue, but when I try to retrieve it in the filters screen using JQL, no results are returned. I haven’t been able to resolve this issue. Could you please assist me?
Issue properties:
{
"keys": [
{
"key": "ajf-lr-result-1",
"self": "https://mertcankarabas01.atlassian.net/rest/api/3/issue/25691/properties/ajf-lr-result-1"
}
]
}
The property:
{
"key": "ajf-lr-result-1",
"value": {
"value": 1
}
}
The jql that i tried:
issue.property["ajf-lr-result-1"].value = 1
Thank you.
Best,
Mertcan.
Hi @MertcanKaraba1 ,
I think, the problem come from indexing, as you add the property on the issue, it doesn’t automatically index your property, unlike the customfields.
Without this indexing, the property isn’t searchable by JQL
With Forge, you need to change your manifest:
Declare a jira:entityProperty module that indexes the value field as a number:
modules:
jira:entityProperty:
- key: "ajf-lr-result"
entityType: "issue"
propertyKey: ajf-lr-result-1
values:
- path: value
type: number
searchAlias: ajfLrResult
Wait a bit until change is done, and try again.
Hi @FlixAndre ,
I’m working on indexing, but is it mandatory to add this to the manifest? I’m developing an app with a custom JQL function, and in some cases, the number of issues returned from this JQL function is very large. For example, it may return 10,000 issue IDs, and I found the best way to handle this is by adding a property to these 10,000 issues and then calling that property value in JQL. At this point, since I can’t include more than 30 entityProperties in the manifest file, I’ll still run into the same problem.
In short, is it absolutely impossible to perform a search without adding the entityProperty module to the manifest?
Ok, I understand your problem.
You can maybe create a customField in Jira, it will automatically index the field, and you can use JQL on it.
@MertcanKaraba1 the properties won’t be indexed, which means they won’t appear in search, unless you add them to the manifest - but you’re correct, you can only declare a total of 30 values this way.
If that won’t meet your needs I think that the suggestion by @FlixAndre is your better bet.
1 Like
Thank you for your help @FlixAndre @mpaisley.
When creating a custom field, I have a concern. Naturally, I don’t want to keep users waiting too long on my app, and I need to update a large number of issues with a custom field. If a user creates multiple custom fields in their Jira, there will end up being too many custom fields.
To avoid this, I wanted to create a single custom field of type label. Then, for the issues returned by my JQL function (based on their IDs), I would add values like result-1, result-2, etc. into that label field.
I found this API:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-values–apps-/#api-rest-api-3-app-field-fieldidorkey-value-put
The issue is: if an issue already has result-1 in this label field, and the JQL function returns that issue again, I also need to add result-2. However, using this API seems to overwrite the existing value (result-1) instead of appending to it. Since users need to be able to save filters and search through Jira’s default filter screen, I cannot afford to lose those values.
The other approach would be to fetch the existing field value for each issue and then rewrite it with the new one, but that would result in many requests and longer waiting times for users.
Do you have any suggestions to handle this scenario? Or should I always create separate custom fields and use those for search instead?
Thanks,
Best regards
Mertcan.