Jira_expression sees 'addonkey__CustomFieldName' as null

I crafted a condition to display webPanels and it looks like so:

                    {
                        "condition": "jira_expression",
                        "params": {
                            "expression": "issue['addon.unique.key__FieldName'].length > 0"
                        }
                    }

which does not work, I tried using /rest/api/2/expression/eval to evaluate my expression I found out that "issue['addon.unique.key__FieldName'] is null even though the field accessed as customfield_#### does return a value.

If I send random values instead of 'addon.unique.key__FieldName' I get a response stating that the value is not valid and a list of valid ones which include 'addon.unique.key__FieldName'

The field is defined like this:

    "jiraIssueFields": [
            {
                "description": {
                    "value": "Some Value"
                },
                "type": "string",
                "name": {
                    "value": "Field Name"
                },
                "key": "FieldName"
            }
        ]

According to available docs this should work and return the same value as customfield_#####, is this a bug? if so how can I report it?

"issue['addon.unique.key__FieldName'] is null even though the field accessed as customfield_#### does return a value.

Are you 100% sure that the customfield_#### identifier corresponds to the field key? Perhaps it’s a different field after all which is why it returns a different value? You can get a list of fields and mapping between IDs (customfield_####) and keys ( addon.unique.key__FieldName) by calling GET /rest/api/2/field.

1 Like

Interesting, you are correct. There were leftover fields causing name shadowing.
Thank you :smiley:

1 Like