Integrating stash with other atlassian products

Graeme Chambers August 2, 2013
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 votes
Graeme Chambers August 9, 2013
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.
0 votes
Helen August 5, 2013

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.

Helen August 5, 2013

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.

cofarrell
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.
August 23, 2013

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

0 votes
J
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 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.

Suggest an answer

Log in or Sign up to answer