How do I manage and retrieve user-specific data in a Jira plugin?

I’m working on a Jira plugin and need help with storing and displaying user-specific info. I want to add input fields on the right panel of the view issue page. Instead of using forms, I’d like to handle this with REST APIs and AJS.

I’ve looked into PluginSettingsFactory and ActiveObjects for data storage, but I’m not sure if they work in REST modules. Can ActiveObjects be used in Jira plugins, or is it just for Confluence?

If I have to use servlets, how can I make POST requests with AJS?

I’m a bit lost here. What’s the best way to tackle this? Any advice would be great!

I’ve been down this road before, and I can tell you ActiveObjects is definitely the way to go for user-specific data in Jira plugins. It’s robust and integrates seamlessly with REST modules. Just make sure to properly inject the ActiveObjects interface into your resource class.

For the AJS POST requests, I’ve had success using AJS.$.ajax(). One trick I learned is to set up a custom error handler to catch and log any issues. It’s saved me countless hours of debugging.

Also, don’t forget about proper security measures. Always validate and sanitize user input on both client and server sides. I once made the mistake of skipping this, and it led to some nasty data integrity issues.

Lastly, consider caching frequently accessed data to improve performance. It made a huge difference in my last project, especially when dealing with large datasets.

hey, i’ve used activeobjects in jira plugins with no prob - it’s not limited to confluence! you can inject it in your rest classes. for ajs posts, use ajs.$.ajax() with type ‘POST’. hope this helps

For managing user-specific data in Jira plugins, I’ve found ActiveObjects to be quite effective. It’s not Confluence-exclusive and integrates well with REST modules. To use it, inject the ActiveObjects interface into your REST resource class.

As for the AJS POST requests, you can utilize AJS.$.ajax() with the ‘POST’ method. Here’s a basic structure:

AJS.$.ajax({
url: ‘/your-endpoint’,
type: ‘POST’,
data: JSON.stringify(yourData),
contentType: ‘application/json’,
success: function(response) {
// Handle success
},
error: function(xhr, status, error) {
// Handle error
}
});

This approach should allow you to handle user-specific data storage and retrieval efficiently in your Jira plugin.