How to access Jira's API immediately after app installs?

I’m trying to access Jira’s API to add some properties to issues immediately after the app installs.

At the moment I’m using the lifecycle hook host_settings_saved and waiting 5 seconds after that before accessing the API (accessing the API immediately leads to a status 400 error).

However, I’m finding that a portion of new evaluators are falling through the cracks. ie The properties are not added and I’m receiving a status 400 error.

I’ve also tried the lifecycle hook webhook_auth_verification_successful but this doesn’t appear to get called at all when I test it locally.

Is there any way to consistently access the API immediately after the app installs?

Seems like a silly question but it’s causing dramas for some new customers.

Thanks in advance!

1 Like

Hi Rhys,

I think it was asked already, but can’t find proper link, so accessing Jira’s API on connect_addon_enabled event works for us with no problems, using nodejs atlassian-connect-express, e.g.:

addon.on('connect_addon_enabled', function (event, body, req) {

Note, you may need to add connect_addon_enabled webhook in atlassian-connect.json:

        "webhooks": [{
            "event": "connect_addon_enabled",
            "url": "/enabled"
        }]

Hope it helps.

Thank you.

1 Like

Thanks @azhdanov this is exactly what I was looking for. Much appreciated.