Hello every body,
I develooped an add-on, using spring-boot, for my coud instance. I want that my add-on dipslayed only in the project X and not in the others.
this is my desciptors:
{ "key": "com.company.issue.showorders", "baseUrl": "https://f0a89b9a.ngrok.io", "name": "Show Orders project", "description": "Show a list of orders", "vendor": { "name": "test", "url": "http://www.my-company.com" }, "authentication": { "type": "jwt" }, "lifecycle": { "installed": "/installed", "uninstalled": "/uninstalled", "enabled": "/enabled", "disabled": "/disabled" }, "apiVersion": 1, "scopes": [ "read", "write" ], "modules": { "webPanels": [ { "url": "/showOrders?issueKey={issue.key}&projectKey={project.key}", "location": "atl.jira.view.issue.right.context", "layout": { "width": "100%", "height": "100%" }, "conditions": [ { "invert": "false", "params": { }, "condition": "user_is_logged_in" } ], "key": "list-orders-key", "name": { "value": "La liste des commandes" } } ] } }
do you have any ideas how can I resolve that problem ?
Thank you for all your answers
You need to use a condition (similar to "user_is_logged_in" which you have used above). One option is to store a entity property on the project which enables your functionality for that particular project and use a property condition to check for that property. If the property is set for a given project, you panel will be shown. You need to figure out how to set that property - one option is to expose some kind of administrative UI, where admin users can add projects, for which your panel will be shown. Or if this is just an internal add-on, you can set the property manually via REST for a given project.
Project Entity Properties are the correct answer to this problem. I would only add a link to the documentation to make this good answer complete: https://developer.atlassian.com/static/connect/docs/latest/concepts/hosted-data-storage.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you guys it work. I would only add some informations about how I did:
to create a property Entity for a "project" type like snippet below, I use rest API:
PUT: https://my-cloud-instance.net/rest/api/2/project/{project-key-or-id}/properties/{propertyKey} the Body of my PUT request: {"isEnabled":true}
then in my descriptor I add a condition like that:
"displayAddonTest" is my {propertyKey}
.... "modules": { "webPanels": [ { "url": "/showOrders?issueKey={issue.key}&projectKey={project.key}", "location": "atl.jira.view.issue.right.context", "conditions": [ { "condition": "user_is_logged_in" }, { "condition": "entity_property_equal_to", "params": { "entity": "project", "propertyKey": "displayAddonTest", "objectName": "isEnabled", "value": "true" } } ], "key": "x-issue", "name": { "value": "Test" } } ], ....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.