How to hide or show jira:issuePanel based on some condition at app level and project level?

In FORGE, I want to display a jira issue panel if entity property of App is set and Entity property for Project is set.
This was quiete easy with connect with “conditions” in atlassian-connect.json.

Question 1:
How do i set App level properties and Project level properties.
I can see https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-properties/#api-rest-forge-1-app-properties-propertykey-put for setting up app entity property. Also this is Experimental, so i can not use in production.
There is no API to set entity property at Project level.
Is there any other way or API available to do this?

Question 2:
How to show hide jira issue panel?
If i am not able to set the entity properties, i will not be able to use displayConditions
entityPropertyExists
entityPropertyEqualTo
entityPropertyContainsAny
entityPropertyContainsAll
and
jiraExpression is available with with App and User context variables as per https://developer.atlassian.com/platform/forge/manifest-reference/display-conditions/jira/

Question is how can I show or hide jira:issuePanel based on condition at app level and project level?

2 Likes

Resolved this issue:
We can use rest api /rest/api/3/project/${projectIdOrKey}/properties/${propertyKey} to set project properties.
I have used jiraExpression to check the properties. Although it says Property value as string. in jiraExpression i have to compare boolean values as app.properties[‘key’]==true rather than app.properties[‘key’]==‘true’

2 Likes

Hi Shiv, could you share an image of your working code’s syntax using the jiraExpression in displayConditions ?
I’m not sure why both don’t work for me, even though I check it does exist via rest api.

displayConditions:
jiraExpression: app.properties[‘my_key’] == ‘true’
displayConditions:
jiraExpression: app.properties[‘my_key’] == true

I just want to see if the syntax is correct.

Thank you in advanced.
–THONG–

      displayConditions:

        jiraExpression: "(app.properties['a-app'] != false &&

          project.properties['a-project'] != false) ||

          (app.properties['a-app'] == false &&

          project.properties['a-project'] == true)"
2 Likes

Thank you for responding Shiv
And I have 1 more question is that
Is is possible for us to use the jira context like current issue.id, issueType.id in these “entity” issue view conditions ?
entityPropertyExists
entityPropertyEqualTo
entityPropertyContainsAny
entityPropertyContainsAll

According to the doc, we only have their properties instead of their fields.