JIRA JQL not working for Entity Properties

Hey, I am using Entity properties for storing custom values, In my app descriptor I have specified index for properties as specified in the docs, but my jql isn’t working. I have tried almost everything.

This is how I’m sending entity property asset while creating issue

        {
            "key": "asset",
            "value": "{\"guid\":\"black\",\"name\":\"logic\"}"
        }

This is my app descriptor

        "jiraEntityProperties": [
            {
              "keyConfigurations": [
                {
                  "extractions": [
                    {
                      "objectName": "asset.qualifiedName",
                      "type": "text",
                      "alias": "assetQualifiedName"
                    },
                    {
                      "objectName": "asset.name",
                      "type": "text",
                      "alias": "assetName"
                    },
                    {
                      "objectName": "asset.guid",
                      "type": "string",
                      "alias": "assetGuid"
                    }
                  ],
                  "propertyKey": "asset"
                }
              ],
              "entityType": "issue",
              "name": {
                "value": "asset Index Document"
              },
              "key": "asset-entity-property"
            }
          ]

Using this as jql issue.property[asset].name ~ logic isn’t working

Please please let me know how can I make this work

the propertyKey does not need to be in the object name - I would specify just “name” or “guid” for the object name.

the propertyKey does not need to be in the object name

Hey, didn’t get what you mean by this, can you give an example @ernst.stefan ?
How should the exact object look like ?

Sure, check here:

"keyConfigurations": [{
                "propertyKey" : "stmLink",
                "extractions" : [{
                    "objectName" : "map",
                    "type" : "text"
                }]
            }]

issue.property[stmLink].map ~ … should work

will try this and get back

@ernst.stefan tried your approach, didn’t work :frowning:
Added this as descriptor

"jiraEntityProperties": [
            {
              "keyConfigurations": [
                {
                  "extractions": [
                    {
                      "objectName": "qualifiedName",
                      "type": "text",
                      "alias": "assetQualifiedName"
                    },
                    {
                      "objectName": "name",
                      "type": "text",
                      "alias": "assetName"
                    },
                    {
                      "objectName": "guid",
                      "type": "string",
                      "alias": "assetGuid"
                    }
                  ],
                  "propertyKey": "asset"
                }
              ],
              "entityType": "issue",
              "name": {
                "value": "asset Index Document"
              },
              "key": "asset-dot-entity-property"
            }
          ]

Inputted this data while on rest/api/3/issue

"properties": [
        {
            "key": "asset",
            "value": "{\"guid\":\"black\",\"name\":\"logic\"}"
        }
    ],

issue.property[asset].name ~ logic jql returns nothing

have you tried quoting the string? I think it needs to be issue.property[asset].name ~ “logic”

are you using the entity properties tool? It helps for debugging and validating that the entity properties are set correctly

Hey, yes i tried with quotes, tried = operator as well.
Haven’t checked entity properties tool, but i have confirmed the entity property using get api, the property is set for the issue in the same format.

That’s why I was confused, I tried everything mentioned in the documentation. But doesn’t seem to work. Might be something i’m doing wrong

how do you update the entity properties, normal PUT the edit issue endpoint or do you set them explicitely via /properties endpoint?

I add a properties object while creating the issue itself
Inputted this data while on rest/api/3/issue

"properties": [
        {
            "key": "asset",
            "value": "{\"guid\":\"black\",\"name\":\"logic\"}"
        }
    ],

I have encountered on Jira Server that this does not effectively index the issue properties and have explicitely set them via property endpoint to work around this.
However Cloud should work both ways

just to make sure, I would use entity property tool to check if they are well formatted

image

This is how the entity property look for the issue


"{\"guid\":\"black\",\"name\":\"logic\"}"

Able to run JSON.parse on the value as mentioned in the doc

Hi, I think this is the problem, there should be no escaped objects here. Try entering the values without escaped quotes in the entity properties app (it will update the value in the background) and then search

I should not JSON.stringify the object value before sending them ?

according to the docs " The value of the request body must be a valid, non-empty JSON blob. The maximum length is 32768 characters."

so I would just post the JS object

1 Like

It worked :tada:
Thanks a lot @ernst.stefan

1 Like