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.
https://community.atlassian.com/t5/Answers-Developer-Questions/Custome-Code-for-installed-atlassian-connect-express/qaq-p/495353
https://community.atlassian.com/t5/Answers-Developer-Questions/ACE-store-data-during-installed-lifecycle/qaq-p/489785
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.