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

Understanding JIRA dependencies and package imports

Hello,

I'm relatively new to JIRA plugin development and as I'm working through various tutorials I've run into a problem where I can only import certain JIRA java classes. For instance, when trying to compile this tutorial to create a custom search request view https://developer.atlassian.com/jiradev/jira-platform/building-jira-add-ons/jira-plugins2-overview/jira-plugin-module-types/search-request-view-plugin-module I found that I can successfully import the following packages:

import com.atlassian.jira.issue.search.SearchException;
import com.atlassian.jira.issue.search.SearchRequest;

but cannot import these packages:

import com.atlassian.jira.issue.search.SearchProvider;
import com.atlassian.jira.issue.search.SearchProviderFactory;

Both SearchProvider and SearchProviderFactory are present in the javadocs for the latest version of JIRA, yet I can't import them despite them being in a package from which I've already imported.

Why is this? I suppose it's some sort of dependency issue but I can't seem to find a way to fix it. I'm using Eclipse, by the way.

Thanks!

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

Both SearchProvider and SearchProviderFactory have been moved out of the API in JIRA 7.x. Check out the Preparing for JIRA 7.x page. As you've guessed, you need different dependencies if you still want to use them, although this is not recommended - use the SearchService instead.

It looks like there is some problem with the Atlassian javadoc as the latest URL shows an older version of the class, while the direct link for 7.1.9 documentation has the appropriate warning in the class javadoc.

Your rule of thumb should be this - depend on jira-api and if the class is in there, then it's an API.

TAGS
Community showcase
Published in Jira Service Desk

ANNOUNCING: Early access ITSM features in Jira Service Desk

Meet the new and improved IT service management template for Jira Service Desk! Here are a few of the powerful features ready and waiting for you: Better focus on ITSM - clear ticket categories...

377 views 6 14
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