Conditions do not work for jiraProjectPages

Hi

I am working on creating a new JiraProjectPage which should be be displayed only on a particular project’s left navigation.

Below is my app-descriptor. The problem is that the link does not display for the right project if I enable the conditions. If I remove the conditions then I am able to view the link correctly

{
  "key": "My-Jira-Integration",
  "baseUrl": "${addon.base-url}",
  "name": "My Connect Jira Integration",
  "description": "My Connect Jira Addon",
  "authentication": {
    "type": "jwt"
  },
  "modules": {
 
  
  "jiraProjectPages": [
      {
        "url": "/jira/lv-release?projectId={project.id}",
        "iconUrl": "/jira/img/my-release.svg",
        "weight": 100,
        "name": {
          "value": "My Releases"
        },
        "key": "my-release-page",
        "conditions": [
                    {
                        "condition": "entity_property_equal_to",
						"params": {
							"entity": "project",
							"propertyKey": "key",
							"value": "LVCON"
						}
                     }
         ]
      }
    ]
  },
  "lifecycle": {
    "installed": "/jira/installed",
    "uninstalled": "/jira/uninstalled"
  },
  "scopes": ["read", "write","project_admin"]
  
}

Is there something that I am not doing correctly? entity project has the property key .

Any help or suggestions around this are appreciated.

Regards
Tejas

6 Likes

Hi @tshah,

Does this only happen with jiraProjectPages module? In order to check what the value is of the said entity property, what does the call to /rest/api/2/project/LVCON/properties/key return?

Cheers,
Ian

2 Likes

Hi tshah,

We have reproduced the same problem. The same conditions work fine for webItems but do not work for jiraProjectPages.

Has you been able to find the solution? Is it Atlassian’s bug?

Update:
The conditions are evaluated when I enter the project context but they are ignored when I navigate to issue details page.

BR,
Volodia

@ianRagudo it does affect jiraProjectPages module. The same condition works fine for the issue Content module and TabPanel.

1 Like

Hi @jack ,

I tried it out with this condition to verify if jiraProjectPages module’s conditions property is being respected and so far it works as expected - the project page link appeared in the sidebar for logged-in users inside projects that are not service desks.

"conditions": [
  {
      "condition": "user_is_logged_in",
      "invert": false
  },
  {
      "condition": "project_type",
      "params": {
         "projectTypeKey": "service_desk"
      },
      "invert": true
  }                
]   

What conditions were you using?

Cheers,
Ian

Hi @ianRagudo,
Here’s an example of condition that fails to work for us:

{
	"or": [
		{
			"condition": "entity_property_exists",
			"params": {
				"entity": "project",
				"propertyKey": "property_key",
				"objectName": "object_name"
			},
			"invert": true
		},
		{
			"condition": "entity_property_equal_to",
			"params": {
				"entity": "project",
				"propertyKey": "property_key",
				"objectName": "object_name",
				"value": "true"
			},
			"invert": true
		}
	]
}

It is meant to hide a sidebar item if the entity property is set to true, otherwise (false or not set) the item should be shown. The problem is with hiding the item. On some pages (e.g. issue page), even though the entity property is true, the sidebar item shows.

1 Like

Thanks for the sample, @kamilw; this has made the replication much easier.

After replicating this issue, I raised the public-facing bug [ACJIRA-2596] - Ecosystem Jira on your behalf. Feel free to comment and watch the issue.

Cheers,
Ian

2 Likes