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

Customizing the JIRA6 code(CreateIssueHandler.java)

Kalyani Khandelwal Aug 01, 2013

Hello, Greetings,

We are migrating from Jira 4.3 to Jira 6

We did some customization in JIRA 4.3 so that the issues generated through mails should be
1. critical issue if mail comes with high importance.
2. To-list and cc-List to be printed along with the description of the issue.
3. People in the cc-list should automatically be created as user for JIRA incase they are not.

In-order to do so we have modified CreateIssueHandler.java present in com/atlassian/jira/service/util/handler pakage.

Bur in JIRA 6 the package and the file is also changed.

it is com.atlassian.jira.plugins.mail.handlers now and i tried propagating the changes also in the same file. but i am not sure how can i compile it. I have the source.zip give by my technical contact to me.

Could you please help me with following,

1. Where should i install the source code?
2. I understand in-order to build the customized source code i need to put the modified source code file under /external-sources/src and built with ant build. but i am not familiar with JIRA6 code structure, where can I find this external sources directory??
3. How to build the source with ant build?
4. Where in JIRA server the modified .class file should be placed so that changes are picked by the new jira6 server.

Please help.

Thanks,
Kalyan

5 answers

1 accepted

1 vote
Answer accepted
Kalyani Khandelwal Aug 26, 2013

I did it using atlassian source code jira-mail-plugin and compiled using atlassian-sdk, cli to compile and genrate the jar file for mail plugin. and Then installed the plugin in add-on, my changes work fine.

Thanks everyone for the help.

Thanks,

Kalyani

Nazeema MS Aug 23, 2015

Hi Kalyani, I am trying to create email handler plugin but I am getting a build error like below, [WARNING] The POM for com.atlassian.jira:jira-mail-plugin:jar:6.4.9 is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 21.868 s [INFO] Finished at: 2015-08-24T12:44:53+05:30 [INFO] Final Memory: 13M/61M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project mail-handler-demo: Could not resolve d ependencies for project com.example.plugins.tutorial.jira:mail-handler-demo:atla ssian-plugin:1.0-SNAPSHOT: Failure to find com.atlassian.jira:jira-mail-plugin:j ar:6.4.9 in https://maven.atlassian.com/repository/public was cached in the loca l repository, resolution will not be reattempted until the update interval of at lassian-public has elapsed or updates are forced -> [Help 1] please help me on this.

Nic Brough [Adaptavist] Community Leader Aug 23, 2015

Posting on a 2 year old question that doesn't have much to do with your question is not going to get you much help - only watchers will see it. Try asking a new question.

0 votes
Nic Brough [Adaptavist] Community Leader Aug 01, 2013

You should have written this as an email handler plugin, not overridden the core code.

https://developer.atlassian.com/display/JIRADEV/Custom+Message+(Mail)+Handler+for+JIRA

Kalyani Khandelwal Aug 01, 2013

Hi Nic,

Thanks for the tutorial, i will try to go through it and customize, but if i still want to go through my method is it possible?

Thanks,

Kalyani

Nic Brough [Adaptavist] Community Leader Aug 01, 2013

Well, you can, but you need to find the classes to replace, build new ones manually, pull out the ones in the core of Jira, place your own in there, recompile, redeploy and worry about how to maintain changes in the core on every single upgrade.

Or, for a plugin, you can use the Atlassian plugin development kit to create a plugin skeleton (one command), copy your existing code into it, with a bit of restructuring, compile, run and test it (one command), deploy it to your Jira (one command) and then tell your Jira to use it instead of the built-in one. No downtime, no mucking with core code, no recompiling, no maintaining core hacks on upgrade, and there's even a good chance it will remain compatible with new releases of Jira without needing to be recompiled.

I'd highly recommend making that effort now, as it'll all be a LOT easier

Kalyani Khandelwal Aug 08, 2013

I am getting below error, when trying to start jira using, atlas-jira,

Please help me solve the same? I could not find any instructions about this artifact download.

Missing:
----------
1) com.atlassian.jira:jira-mail-plugin:jar:6.1-20130626

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=com.atlassian.jira -DartifactId=jira-ma
il-plugin -Dversion=6.1-20130626 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:

mvn deploy:deploy-file -DgroupId=com.atlassian.jira -DartifactId=jira-mail
-plugin -Dversion=6.1-20130626 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
-DrepositoryId=[id]

Path to dependency:
1) com.example.plugins.tutorial.jira:mail-handler-demo:atlassian-plugin:
1.0-SNAPSHOT
2) com.atlassian.jira:jira-mail-plugin:jar:6.1-20130626

----------
1 required artifact is missing.

for artifact:
com.example.plugins.tutorial.jira:mail-handler-demo:atlassian-plugin:1.0-SNAPS
HOT

from the specified remote repositories:
atlassian-plugin-sdk (file://C:\Users\kakhande\atlassian-plugin-sdk/repository
),
central (http://repo1.maven.org/maven2),<br< a="">> atlassian-public (https://maven.atlassian.com/repository/public)

0 votes
Kalyani Khandelwal Aug 01, 2013

Hi Nic,

Thanks for the tutorial, i will try to go through it and customize, but if i still want to go through my method is it possible?

Thanks,

Kalyani

Kalyani Khandelwal Aug 08, 2013

Thanks Timothy for answer, but should I change my pom.xml to add this dependency or should I download it to my system? I am not sure where this automatic download procedure of JIRA will put this jira-mail-plugin inorder to pick up the changes.

0 votes
Kalyani Khandelwal Aug 13, 2013

Hi Timonthy,

Thanks for the link, Actually i had to download and put everything to atlassian local repository, ad then again executed atlas-run, I am getting below error.

[INFO] Building Mail Handler Demo
[INFO] task-segment: [com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:4.2.5:run]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing amps-dispatcher:run
[INFO] artifact com.atlassian.maven.plugins:maven-amps-plugin: checking for updates from atlassian-public
[WARNING] repository metadata for: 'artifact com.atlassian.maven.plugins:maven-amps-plugin' could not be retrieved from repository: atlassian-public due to an error: Error transferring file: Connection timed out
[INFO] Repository 'atlassian-public' will be blacklisted
[INFO] artifact com.atlassian.maven.plugins:maven-amps-plugin: checking for updates from atlassian-plugin-sdk
[INFO] artifact com.atlassian.maven.plugins:maven-amps-plugin: checking for updates from central
[WARNING] repository metadata for: 'artifact com.atlassian.maven.plugins:maven-amps-plugin' could not be retrieved from repository: central due to an error: Error transferring file: Connection timed out
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'com.atlassian.maven.plugins:maven-amps-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 minutes 34 seconds
[INFO] Finished at: Wed Aug 14 14:04:44 EEST 2013
[INFO] Final Memory: 11M/109M
[INFO] ------------------------------------------------------------------------

I am not sure what else is needed. Could you please help?

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase

Friday Fun: What's your best vacation planning hack?

Let's face it, work can be challenging but fulfilling, especially when you enjoy the challenges thrown at you.  However for me, nothing compares to going on vacation (or holiday as some of you m...

519 views 26 4
Join discussion

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