You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I'm trying to perform certain actions after plugin is installed. I'm familiar with ActiveObjectsUpgradeTask, but since this action has nothing to do with database I'm looking for a more elegant solution. I found an article regarding PluginUpgradeTask, but it's heavily outdated - when I try to use component element in atlassian-plugin.xml, I'm getting following error:
atlassian-plugin.xml contains a definition of component. This is not allowed when Atlassian-Plugin-Key is set.
Linked help document describes that I shouldn't be using component element and use @Component annotation instead. This of course doesn't work.
How do I make PluginUpgradeTask work OR what should I use instead to perform actions right after my plugin is installed?
Turns out I didn't implement all methods from PluginUpgradeTask interface and when my IDE suggested I make my class abstract I accidentally clicked this option. I figured it out when I defined my upgrade task explicitly in spring context file and spring thrown an error. Removing abstract keyword from class declaration solved it.
So to sum up, all you really need to run upgrade task is to implement PluginUpgradeTask interface and annotate your class declaration with
@ExportAsService(PluginUpgradeTask.class)
@Component
You don't need ExportPackage entry in pom.xml
Great you found what you needed!
Usually when people are looking for learning how to develop an app I recommend this open source : https://github.com/atlascommunity/jira-plugins-groovy of MyGroovy app
This repository has a lot of useful tips,
an example of upgrade task implementation:
How you can handle your plugin lifecycle (Start/Stop...):
Probably there are others source codes you can look and learn from, but this is a complete and well written example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would say you need to look in the Lifecycle https://developer.atlassian.com/server/jira/platform/plugins2-add-ons/#jira-add-on-lifecycle
I recommend you to continue this question using the Development community. there they will be able to better assist you with your query
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the tip regarding dev community, I didn't even know it exists.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.