Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use the Java API?

Brian L August 8, 2022

I'm trying to figure out how to work the Java API for Jira.

 

I've added in this dependency into my pom.xml:

<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${jira.version}</version>
<scope>provided</scope>
</dependency>

 

I am trying to use the DefaultPluginManager Java API and imported:

com.atlassian.plugin.manager.DefaultPluginManager

 

I then added the following code:

@JiraImport

private final DefaultPluginManager defaultPluginManager;

 

public PluginDemo(DefaultPluginManager defaultPluginManager) {

 this.defaultPluginManager = defaultPluginManager;

}

which worked fine. As a test then, I tried to use the getPlugins() method to gather all the plugins but the only way I got it to work is if I did:

Collection<com.atlassian.jira.plugin> list = defaultPluginManager.getPlugins();

It didn't throw any errors at me when I ran atlas-run, but whenever I would load up the plugin it didn't load up onto the localhost Jira server, saying the plugin could not be deployed in time.

 

Am I missing anything for using the Java API?

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events