Hi guys,
I’m using the SearchService to perform my issue searching, but there is a breaking change in the API between Jira 7.13 and Jira 8.x.
For Jira API version 7.13.5, the API looks like this:
SearchResults searchResult = searchService.search(user, query, filter);
return searchResult.getIssues();
But for Jira API version 8.8.5, it changed to:
SearchResults<Issue> searchResult = searchService.search(user, query, filter);
return searchResult.getResults();
This makes my plugin compatible with only one major version of Jira, either 7.x or 8.x. It cannot work for both versions with just one jar.
My expectation is to support both Jira 7.x and 8.x with just one jar. I found some articles and design patterns called “Bridge” to handle this problem, but up to now, I couldn’t make it work. Here are the links:
- How to support multiple versions of Jira in one plugin
- Practical Patterns for Developing a Cross-product Cross-version App - YouTube
After some time trying to implement my own bridge, I found a library which already does this for me, it called jira-cross-compatibility-lib-bridge-api, and here are the dependencies:
<dependencies>
<dependency>
<artifactId>jira-cross-compatibility-lib-bridge-api</artifactId>
<groupId>com.atlassian.jira.compat</groupId>
<version>0.51</version>
</dependency>
<dependency>
<artifactId>jira-cross-compatibility-lib-bridge-factory</artifactId>
<groupId>com.atlassian.jira.compat</groupId>
<version>0.51</version>
</dependency>
</dependencies>
This library contains many bridges for many services, but seems like it has been stopped developing, the bridges are just for Jira 6.x and 7.x.
I’m looking for:
- A library similar to the above one to handle API breaking change
- A discussion in this post about this compatibility problem. Is there any example or best practice which are solving this