How to generate target url using generateTargetUrl() during an app update

Hi,

I am facing an issue during app update.
I need to update a web-hook during an app update.
As there is no event triggered during an app update I am unable to call getTargetUrl() method.
Is there a workaround/could you guys suggest a workaround until an “OnTicketUpdate” event is introduced?

Thanks

2 Likes

Hi Syed,

First of all, welcome to our community! :tada:

Could you share the use-case for the need to update the webhook URL for each version update? This will help provide a workaround if available.

1 Like

I am slightly confused as in, onTicketUpdate seems to be available and I am not able to comprehend what could be the need that updation of webhook could solve during an app update that compensates onTicketUpdate product event.

I am clearly missing something. Can you please help by rephrasing a bit more? Additionally, as @Raviraj suggested, adding a usecase could help us see big picture to suggest with alternatives.

Hi @Saif and @Raviraj ,

Sorry, I meant to write, OnAppUpdate.
The use case is as follows:

There is an already existing custome app which is running.
During OnAppInstall, this app creates a webhook in VSTS to perform some specific actions in freshservice.

Now I have updated this custom app which has newer logic and functionality.
This newer functionality requires that I need that same webhook to perform some more actions in freshservice.

When the app is updated I need to update existing webhooks configuration or delete exisitng webhooks and create new webhooks with the newly desired configuration.

But there is no such event that is triggered during a app update.

For now the only way seems to either:
1,Manually update the webhook in vsts.
OR
2,Unintall and reinstall the app, which will cause to erase the config/db data.

So I wanted to know is there a workaround that I can do which will avoid both the above mentioned steps?

2 Likes

@syedm There’s no event available to trigger for each app update. I will move this to the Feedback category and pass this to our team to validate and consider it in the roadmap.

As a workaround, a custom validation can be added in the custom installation page to register the webhook in the third-party service before updating the app.
This flow is expecting the previously generated webhook is stored in the Data Storage to get it on this method to use. Also, the custom installation page has to be introduced if not used before.

Let us know if this will work for your use-case.

2 Likes