Forums

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

Change default implementation of Jira's public API

taidt1 December 10, 2018

I am writing the plugin for Jira by using Atlassian SDK and I want to change the logic of 

API:

com.atlassian.jira.issue.changehistory.metadata.HistoryMetadataManager (its default implementation is 

com.atlassian.jira.issue.changehistory.metadata.DefaultHistoryMetadataManager)

Is it possible? If yes, how can I implement it, thank a lot.

I have used injection annotation of spring like @Primary @Component but it does not run correctly, the default implementation cannot be overriden by this way.

 

I think the solution will be the same for confluence, bitbucket,....

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 11, 2018

That's a core built-in function, you'll need a "type 1" plugin, or changes to the main code if you want to override it.

I'd recommend not doing that.  Write a "type 2" plugin that provides an extra REST endpoint to do what you need, and leave the main code alone.  You'll find it easier to write, support and upgrade.

taidt1 December 13, 2018

Could you give me the example of "type 1" plugin any documents, actually, I really want to change the behavior of the core code.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2018

No, seriously, you don't want to do this, it's a nightmare to write, implement or support and wrecks your chances of upgrade.

The developer docs do have stuff on writing them, but it's not explicitly "type 1", it's just quietly pointed out that installation and usage is manual and risky when you get to it.

Suggest an answer

Log in or Sign up to answer