Hey everyone! I’m just starting out with creating plugins for JIRA and I could really use some advice. I’m trying to figure out how to set up a redirect for all users who aren’t admins when we’re doing maintenance work. It would be great if someone could point me in the right direction.
Also, I’m wondering if it’s possible to send some info from a user interface to a bit of code that would control when the maintenance period begins. I’m not sure how to connect these parts.
I’m pretty new to this, so any tips or examples would be super helpful. Thanks a bunch for any help you can give!
I’ve tackled this issue before in my JIRA projects. A servlet filter is indeed a solid approach for redirecting non-admin users during maintenance. You can implement it to check user roles and redirect accordingly. For the maintenance trigger, consider using the REST API to create an endpoint that toggles a maintenance flag in your plugin’s settings. This way, you can control it through a simple UI or even automate it with scripts. Remember to thoroughly test your implementation, especially the role-checking logic, to avoid accidentally locking out admins. The Atlassian SDK documentation is a goldmine for examples and best practices on these topics.
I’ve been working with JIRA plugins for a while now, and your question brings back memories of my early days. For redirecting non-admin users during maintenance, a servlet filter is indeed a solid choice. It’s relatively straightforward to implement and gives you fine-grained control over user access.
As for triggering maintenance mode from a user interface, you might want to look into creating a custom REST endpoint in your plugin. This endpoint could toggle a maintenance flag in your plugin’s settings, which you can then manage via a simple admin UI.
One thing I learned the hard way: always include a failsafe mechanism. You don’t want to accidentally lock yourself out during testing! Also, be sure to consider edge cases, such as actions that might be interrupted if a user is in the middle of an operation when maintenance begins.
The Atlassian SDK is a great resource—it offers plenty of examples and tools to help you get started. Good luck with your project!
thanks for sharing. i ran into similar problems before. try using a servlet filter to redirect non-admin ppl and event listeners for triggering maintanence. atlassian docs r helpful. hope it helps!