Mail Notification for svn commits from jira

jayasingh April 29, 2014

Hi,

We are planning to integrate jira with jira subversion plugin.

Can any one please suggest whats the way to send mail notification whenever the user commits from SVN. Is there any way to trigger mail from jira like issue creation,issue closed etc same for issue commit?

Thanks in advance

Regards,

Jai

2 answers

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 29, 2014

The Atlassian subversion plugin really does only do the basics. It reads subversion for relevant information, indexes it locally, and then checks the index when a user looks at an issue. It's a passive pull - it issues a simple "what's changed since I last asked you" call to subversion and parses the result.

If you want it to do more, you'll have to code the whole lot into the plugin - if you want to go that way, I'd be looking at the pull-and-index step, where you'll need to persuade it to fire events if you want to use Jira's internal notification schemes.

There's also the Subversion ALM plugin. More features, but not including email on subversion change. I don't know the internals of that at all though, it could be (and probably is) a lot closer to what you need.

Finally, I'd not actually bother with Jira. It's a doddle to write "send email" scripts in bash/python/ruby/your-language-of-choice, and use one of them as a post-commit hook on the subversion repo.

Pablo Beltran
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.
April 29, 2014

Subversion ALM is closed source. However, it is open in some sense as it provides full access to the whole Subversion indexed data through standard JDBC and fires events to notice other plugins about new commits.

So you can do almost anything like watch modifications under a directory and send email notifications, create new issues or change their status, etc. There are not much limits about you can do as you have full access to JIRA through the Java API, full access to Subversion (by including the Java SVNKit API in yout pom.xml) and Subversion ALM indexed data (by using the Java API). I cannot imagine anything more open and powerful.

0 votes
Pablo Beltran
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.
April 29, 2014

If you use the Atlassian's plugin, then you have to modify the source code to support it.

If you use the alternative Subversion ALM plugin, things are a bit easier as it fires an event for every Subversion commit that you can capture from your own custom plugin and interact with JIRA accordingly.

You have to code with both plugins, but in my opinion, Subversion ALM is one step forward in this field.

There is available an example for commit event subscription here:

https://code.google.com/p/jira-svn-alm-db-demo/

Suggest an answer

Log in or Sign up to answer