It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Atlassian Connect Express - unable to store tenant info in mysql table Edited

Hi guys,

Does anyone managed to use mysql as store for ACE and each time new add-on is registered with cloud instance, does the secretkey is being updated in AddinSettings table?However it does work if i manually create mysql table and add the response from POST that sent to my app via callback=/installed.

1 answer

1 vote

Gobinath,

Can you verify with us what product you're developing for? I'd like to make sure to tag this properly so it can be seen

Regards,

Shannon

I am also facing same issue. I am developing the JIRA Cloud Instance add-on using Atlassian-Connect Express. please resolve this issues. Cannot able to find much info on this

Sarthak,

Have you reported this issue at Ecosystem or our Developer Community yet? These are the resources you would use to report an issue or a problem you're having developing an add-on.

Let me know if you have any trouble!

Shannon

Hi @Shannon Spaniol,

Apologize, I have overlooked your reply.

 

Hi @Sarthak Srivastava,

I managed to solve it by installing following NodeJS packages:

 

// add the following route handler in routes/index.js

app.post('/installed'function(reqres) {

console.log('Installed [Callback] :'req.body); //Update AddonSettings Table

addon.settings.set('clientInfo'req.bodyreq.body.clientKey); //this the part manually added as part of workaround to register app

infoLog.info('[Installed Callback] Successfuly Installed in JIRA [Request Body:' + JSON.stringify(req.body+ ']');

res.status(200).send();

});

Also, in path "/node_modules/atlassian-connect-express/lib/store/jugglingdb.js", you can customize the table to store the addOnSettings which store the key to decrypt the JWT token. Importantly, the table need to have fields like "id,clientKey,key,val".

e.g 

function JugglingDB(loggeropts) { opts = opts || {}; var self = this; self._data = {}; self.promise = new RSVP.Promise(function(resolve,reject) { var type = opts.type || 'memory'; var schema = self.schema = new Schema(typeopts); schema.extend('AddonSettings', { clientKey: { type: Stringindex: true }, key: { type: Stringindex: true }, val: Schema.JSON }, { table:'JIRA_AddOnSettings'}).then( function (AddonSettings) { return new RSVP.Promise(function(resolve) { AddonSettings.schema.autoupdate(function() { resolve(AddonSettings); }); }); }) .then(function(AddonSettings) { self._AddonSettings = AddonSettings; logger.info('Initialized ' + type + ' storage adapter'); resolve(); }, function (err) { logger.error('Failed to initialize ' + type + ' storage adapter: ' + errmsg(err)); reject(err); } ); }); _.bindAll(self'get''set''del');}

 

And,configuration for "store" object in "config.json" should be something like this:

"store": { "adapter""jugglingdb", "type""mysql", "host""127.0.0.1", "username""root", "password""", "database""jira_plugin" },

 

With all these changes, I managed to get it work!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Expose your beautifully crafted Dashboard through the Jira Service Desk Customer Portal

  A picture is worth a thousand words, especially when you're trying to find relationships and understand your data. Here, Dashboards play a vital role in gaining insights from a variety of dat...

221 views 3 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you