Hide a link to a custom app from project sidebar in Jira via REST API

Hello,

I am using atlassian-connect.json for our application and also using modules.jiraProjectPages to include a new link within the Project sidebar.

{
    "apiVersion": 1,
    "modules": {
        "jiraProjectPages": [
            {
                "key": "project",
                "name": {
                    "value": ""
                },
            }
        ]
    }	
}

The code above will add a sidebar link into every single project in jira, but this behaviour is unintended for some of my clients.

I would like to hide the automatically generated sidebar link on some projects and I believe it is possible to be accomplished via Jira REST API, since I’ve noticed some plugins are having that exact functionality.

But I was unable to find hiding project links from the sidebar within the API documentation https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/()

Any advice would be appreciated.

Thank you

Hi @hanakivan , I am having a similar demand. Have you ever found a solution?
Cheers Bernie

Hi @hanakivan

I found that the easiest way to conditionally show a a item to a page module is to separate the module from the link.

To this end I set the location of a page module to not-a-valid-location and create a web-item that will create the link in the correct section.

Thanks this example for instance:

{
	"modules": {
		"webItems": [
			{
				"key": "project-admin-item",
				"location": "atl.jira.proj.config/projectgroup4",
				"weight": 100,
				"url": "/plugins/servlet/ac/${addon.key}/project-admin?project.key={project.key}&project.id={project.id}",
				"name": {
					"value": "My Project Admin Page"
				},
				"context": "product",
				"conditions": [
					{
						"condition": "entity_property_equal_to",
						"params": {
							"entity": "content"
							"propertyKey": "flagged",
							"value": "true"
						}
					}
				]
			}
		],
		"jiraProjectAdminTabPanels": [
			{
				"key": "project-admin",
				"location": "not-a-valid-location",
				"url": "/admin/configuration/{project.key}?projectid={project.id}",
				"weight": 100,
				"name": {
					"value": "My Project Admin Page"
				}
			}
		]
	}
}

The entity property based conditions can be great for making the condition dynamic specific to the app, simple set the entity property using the API and you are good to go.

See https://developer.atlassian.com/cloud/jira/platform/connect-conditions/ for all the available conditions.

Hope this helps.