Check for Jira issue key when commiting

CrownConsult January 6, 2018

Hello,

 

I am looking for some help with script to check Jira Issue Key while commiting .

I am using Subversion Edge SVN on windows.I don't have any experience in scripting and don't know where to start.

 Basically this is what I expect.

"Restricting-Subversion-commits-if-the-Jira-Issue-key-is-Not-in"

 

1 answer

0 votes
miikhy
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.
January 8, 2018

Hi,

Definitely a good initiative. I would recommend you use bitbucket on top of GIT but if you're using Subversion/SVN and don't want to bring any change, you might have a commit hook which checks Jira through the REST API.

If you can identify a Jira key in the commit message (using a regular expression?) you can then send a query to the remote API to check for key existence. That might be the easiest way.

Hope this helps!

CrownConsult January 8, 2018

Thanks a  lot for response.

Actually I am very new to this.And I don't have any idea how to write a precommit hook to check for this.

If you can be any help that would be great.

miikhy
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.
January 9, 2018

I'm sorry but I,m proficient with Bitbucket but don't want to lead you in wrong path on building hooks directly on Subversion, I might not be the best person to help you out, hope this will be taken a step further by any other Champion or Community member :)

CrownConsult January 9, 2018

Ok.So what does bit bucket do?

miikhy
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.
January 9, 2018

Well bitbucket is a visual interface to manage your source code repositories using Git. I know there are easy solution to migrate from SVN to Git as it's kind of the new market standard but don't want to suggest you to rework all your way of working :)

The interest of Bitbucket is mainly its perfect integration with Jira which would allow you to track which commits are linked to which jira issues directly in Jira or Bitbucket itself and to sync pull requests as well, even builds! That's also an Atlassian tool with a lot of plugins on the marketplace which means you can easily extends its feature to fit your needs better.

A few highlights are available here: https://www.atlassian.com/software/bitbucket

Much more to discover on tutorials and blogs if you're interested!

CrownConsult January 9, 2018

Hello Micky,,

 

I have installed Bitbucket with GIT on my server.How do I start with it now?Does it work same way as SVN?

CrownConsult January 9, 2018

Hope you can help me with setup and integration.

I am going to purchase Jira and Bamboo today. if Bitbucket is succesfull will go ahead and purchase that as well.

miikhy
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.
January 10, 2018

Hi,

Unfortunately I'm afraid the Community might be a simple guide but not a full partner for integration.

I advise you to get in touch with a local partner who can help you setuping and integrating all applications together, there might even be more services you could benefit from. Also, if you want to try it by yourself, you might want to use an evaluation license in a dev environment to try and use the products and check how it work.

The quick thing I can add is that Bitbucket is slightly different than SVN as it's using Git but it's a well done interface to help you and your devs working easily. There's even SourceTree which can be useful for your dev people to checkout, commit, pull request code etc...

Good luck with your integration, keep us posted if you have more precise questions!

Cheers

CrownConsult January 10, 2018

Thanks

intergration is already done.

 

But I was not able to find out any guide to set Pre-Commit hook to check for Jira issue key.Can you give me some links that will works?

miikhy
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.
January 10, 2018

Sure, glad you've managed to get there!

In the past I,ve used various ways but the easiest one I've found to check a commit message was an addon which is free and so powerful: YACC (Yet Another Commit Checker). You can have a look here: https://marketplace.atlassian.com/plugins/com.isroot.stash.plugin.yacc/server/overview

In your case I think the Jira issue checker will help a lot! You can check if an issue exists in Jira before allowing a commit and even restrict a subset with a query!

Hope this helps!

Cheers

Suggest an answer

Log in or Sign up to answer