How do I write jira expression on web-item condition?

I am trying to add the condition for web-item using jira expression. I created the app property with value as json as below:

theRequestURL = ‘/rest/atlassian-connect/1/addons/{my-addon-key}/properties/conditions’
data: ‘{ “for-users”: “true”, “for-admins”: “true” }’

for web-item condition as below:
{
“condition”: “jira_expression”,
“params”: {
“expression”: “app.properties[‘conditions’].for-users == ‘true’”
}
}

The above expression is not working. Any idea, what was the issue on the expression.

I appreciate all your opinions and suggestions.

1 Like

.for-users is causing a syntax error, use computed member access instead, like this: app.properties[‘conditions’]['for-users']

1 Like

Thanks for your inputs. It is working.

I have changed the input as well. data: ‘{“forUsers”:false,“forAdmins”:true}’,

Thank you.