Developing a Node ACE based addon to implement custom post functions, but I must be doing something wrong

Hi Guys

I used to be a Java coder back in the day, but first of I must confess I haven’t stayed up to date with all the latest tech, and feel like I am misunderstanding something fundamental here.

In short I have started with this example, to build on from it https://bitbucket.org/atlassianlabs/atlassian-connect-jira-workflow-post-function-example

What I find painful at the moment is that I have to restart node every time I change something in the Javascript, and then re-install the addon to my dev Jira instance.

I have solved the manual restart issue by implementing nodemon, so it auto restarts, but this means the ngrok bundled with the example ALSO restarts, and thus use a different URL.

I find this an awful lot of hoops to jump through for every line of code changed, so I assume I must be missing some fundamental understanding of the processes followed by people more experienced in developing Jira addons.

Some of the documentation mention you can use the SDK to run local instances of Jira / Confluence, but then the SDK docs says it is being deprecated. Feels like I am reading a bunch of conflicting things in the various articles I read, and not sure what to believe anymore.

Is anyone willing to try and help me out here? In short, all I want is to capture the request sent to me by the post function in jira being fired, and then be able to code against it as I figure out what I want to do with it, without having to restart servers, get new ngrok URL, install addon again using new URL, etc.

I am probably being stupid, but I will happily accept being told that, if someone can help me understand a better way of doing this?

Hi @fritz,

welcome to the Atlassian Developer Community.
As you’ve mentioned that you are using ACE I would recommend you to take a look at the README file: https://bitbucket.org/atlassian/atlassian-connect-express

And specifically the section on Automatic Registration, that explains how you can restart and register your add-on automatically.

Hi @pvandevoorde

I have read that part, and I have my addon set up so that it registers automatically when I start the server, and de-registers itself when I shut it down. I guess I am unsure of what “registration” actually means?

For example, if I start my app the first time, with an ngrok url of http://aaaa.ngrok.io, and I use that URL to install the addon to my Jira dev instance, it registers and all is hunky dory.

I then make a change to the JS, and restart my app. This causes it to use a new nrgok url, lets say http://bbbb.ngrok.io. It does successfully register the app to my dev instance, but I am unsure what this means. From one of the articles I read, I was under the impression that I have to manually re-install the app on the dev instance after each change to the JS.

Did I understand that wrong, and does “re-registration” update the app with my changes, as well as the new ngrok url?

So if I get my app to restart on all JS changes using nodemon, and the app registers itself successfully on every restart, do I not need to re-install it manually?

Sorry for the noob questions, it’s been a few years since I coded something myself, and the documentation I’ve read from various sources seem to contain conflicting information.

For example most of the tutorials I’ve gone though suggests using AP.define(), but when I run them I get warnings that the code is deprecated, and I can’t seem to find info on what I should replace it with.

Thanks for your help thus far though :slight_smile:

If you use the re-registration feature of ACE it will indeed reinstall your add-on with all the changes you’ve implemented and using the new ngrok url.

Oh! Marvelous! Thanks @pvandevoorde that makes a lot more sense now!