Making entity property searchable

Hi,

I have been trying to figure out a way of making my issue property searchable, but have failed so far. My property is an array of JSON object in the following way :

[
{
“id”: “xyz”,
“role”: “dev”,
“key”: “admin”
},
{
“id”: “xyz”,
“role”: “test”,
“key”: “abc”
},
. . .
]
I am not able to figure out what would be “objectName” and “type” in the extractions, for the above format data. The tutorials have a few points on the array type properties, but i am not sure how will that help my cause, since i dont think i can re-format my data too much, as a lot of code has already been built around it.

Please help me out as soon as you can, as this is a big hurdle for me.

Thanks,
Abhinav.

Hi, @abhinav.ojha,

I’m afraid you can’t index properties that are arrays. You property needs to be an object. For example:

{
    "ids": ["xyz", "zyx"],
    "roles": ["dev", "text"],
    "keys": ["admin", "abc"]
}

My advise would be: you can still retain your original properties if you’re using them for purposes other than JQL search, and just add additional properties that you would use only for indexing. However, that would require you to keep both in sync, which could be burdensome; it’s always better to have just one source of truth. Perhaps think about restructuring your original data then.

Hope this helps.

Cheers
Krzysztof

2 Likes

Hi @kkercz,

Thanks for the reply. I will have to rethink about this then, but it would have been much simpler if the “extractions” would take “array” and/or “json” as “type”, which will solve so many problems.

Anyway, thanks for the clarification and appreciate your quick response and help.

Regards,
Abhinav.

@kkercz I mentioned this before in another post: The example in the documentation on entity properties is really misleading.

It shows how to store this content in the issue property tasks (plural!)

 {“content”:“Test if works on Jira Cloud”, “completed” : 1}

The fact that it says tasks and the screenshot suggest that you can store multiple tasks in this property. I think readers of the documentation (like myself) then think that you could just store an array of tasks in the property (which you can) but then realize later that you can’t index an array at the property root.

The examples in the documentation do not match with the screenshot unless I am missing something or you use some fancy encoding to cramp multiple tasks into the same content and completed attribute.

Would be good if this documentation gets an overhaul and is very explicit about the fact that if you use anything other than an object as the property root, indexing won’t work.

2 Likes

I totally agree, @tbinna, the current documentation is misleading.

Could you report this by clicking on the “Give docs feedback” button at the top of the docs page?

1 Like

:ok_hand: sure, I will do that.

We are currently working on this documentation to improve the experience and clarify how this feature is used.

1 Like