I can successfully register and install my app on my Jira Instance and I have code in my app.ts to fire on the "host_settings_saved" event but that code is never run. I understand from these posts that this event is supposed to get fired when the addon is installed on an instance.
Am I doing something wrong with the way I am checking/executing on the "/installed" path.
atlassian-connect.json
{ "key": "xxxxxx",
"name": "xxxxx Plugin",
"description": "Description",
"baseUrl": "{{localBaseUrl}}",
"enableLicensing": false,
"links": { "self": "{{localBaseUrl}}atlassian-connect.json",
"homepage": "{{localBaseUrl}}atlassian-connect.json" },
"authentication": { "type": "jwt" },
"lifecycle": { "installed": "installed" },
...}
app.ts:
let listeners = require('./utils/AddonEventListener');
listeners(app, addon);
...
app.post('/installed', function (req, res) {
res.sendStatus(200);
});
AddonEventListener:
export = (app, addon) => {
/** * fired when addon is installed on a new instance */
addon.on('host_settings_saved', async (clientKey, data) => {
//do something
}
Logs:
Local tunnel established at https://413a7750.ngrok.io/
Check http://127.0.0.1:4040 for tunnel status
Registering add-on...
GET /atlassian-connect.json 200 10.781 ms - -
POST /installed 200 4923.620 ms - 2
On a side note, I found that if I use:
addon.on('addon_registered', async (clientKey, data) => {
}
It does trigger but doesn't contain any clientKey or data.
I was having the same issue today. It looks like when you set up your own route handler in express for the 'installed' lifecycle hook, it disables the default Atlassian Connect behavior.
Removing the express route handler for '/installed' from my app, but leaving the
{ "lifecycle": { "installed": "/installed" } }
in my addon descriptor made the events fire.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.