Integrating stash with other atlassian products

We've recently bought most of the atlassian suite and now want to integrate it all together. I haven't been able to find the "right" answers for what we want to do. Can anyone provide some hints as to how we can get these working? - enforce that stash commits/pull requests contain a valid jira issue number - the jira issue/story should be in our "in progress" workflow state when a commit occurs - a stash pull request initiates a crucible peer review request and moves the jira issue into our "in review" state - a merge of the pull request can only occur when the crucible review is complete thanks for any help, Graeme

3 answers

0 vote
Jay Rogers Atlassian Team Aug 03, 2013

Hey Graeme, this is Jay at Atlassian. In order to answer your question I'd like to know a little bit more about how your team is working - just sent you a note.

I'm interested in this too, specifically how to enforce that stash commits/pull requests contain a valid jira issue number and the validation of issue state when committing.

Meant to add, everything I've found so far suggests that local repostitory commits in git cannot validate the jira issue number, although the git pre-commit hooks could be used to enforce (through pattern matching) that an issue number is in the commit message.

Hi Helen,

It depends on what level of validation you want/need to support. There are few options. As you mentioned you can validate the message at the local/commit level:

http://stackoverflow.com/questions/1501853/jira-code-validation-commit-hook-for-git

The first example, while a little hard-coded, basically checks the message format. While being a little naive, this can be surprisingly effective. Somewhat similar to the other responses you could also write a script to ping a known JIRA and check the existance of the JIRA issue and fail if it can't be found. The problem with this is that every commit will take a few seconds, which might get annoying.

Finally, just for completeness, you can also enforce the commit message on the Stash side:

https://bitbucket.org/cofarrell/stash-enforce-message-hook-plugin

I wouldn't actually recommend this. Sure, ideally the server would enforce this for you, but the realities of DVCS are that you can't really control content in the same way that you might for SVN. A push containing 100 news commits is going to be a nightmare to rewrite if one of those commits is missing a JIRA key. Depending on your workflow you might enforce that everyone has to create a Pull Request instead of pushing to master and that the branch has to contain a JIRA keys.

The first suggestion, enforcing at the local commit level, is what I would suggest to start with. The biggest hurdle with ths approach is distributing/managing the hooks across your organisation and users.

Regarding validation of issue state, this might be of interest too:

https://marketplace.atlassian.com/plugins/com.hindsighttesting.story-flow-plugin

I hope some of that helps.

Charles

We are basically trying to force the use of the workflow we have developed inside JIRA. We have made some states which directly map to the other atlassian products: "In progress" should correspond to feature branch commits inside stash, "In Review" corresponds to a pull request, and crucible review. Basically we want to have the states move automatically when the particular events occur.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

764 views 2 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you