bitbucket cloud - force Pull-Requests to be connected to JIRA issue - bitbucket

I want to make sure each created/approved/merged PR is connected to a JIRA issue.
I currently can "Require issue keys in commit messages", but this forces each commit to have the JIRA issue in it. All I want is the PR (or the branch) to have it.
Is there another way to make sure no branches/Pull-requests are merged (or even created) without linking it to JIRA?

Related

Unable to create branch in Bitbucket from Jira ticket because of Control Freak error

We're getting the attached error when trying to create a branch via a Jira ticket.
I understand that a Control Freak commit policy is preventing the creation and that I can disable that policy.
But I need to understand what exactly is the cause.
I'm surprised to see it complain about merging, although we're speaking about creating a branch.
What does the policy exactly check and in what case would it prevent branch creation?

Integration Jira - GitLab

I would like to exploit the integration between the two tools to be able to automatically create a branch in GitLab for every new Bug or Feature ticket created in Jira.
I would like to know if (i) it is possible; (ii) what is the link between the two tools (I guess the unique ID number assigned by Jira); (iii) assuming the first point is true, what happens to the created branch when I close the Jira issue (e.g. I've mistakenly created a bug fix that was not needed).
I've used Jira in conjunction with GitHub so I'll try my best to help you.
I) This is definitely possible.
II) We used to use the unique ID given to a ticket and include it within in the branch name this creates a link between both tools. Any changes committed on the branch will be shown in JIRA.
III) From experience when this happens the branch will persist and will need to be deleted manually using a console we used to use a .git console and used a delete command.
I also found through a quick google search some documentation on GitLab on integration with JIRA as well as some insight on creating branches.
Doc - https://docs.gitlab.com/ee/user/project/integrations/jira.html
Branch - https://gitlab.com/gitlab-org/gitlab-ce/issues/3886
Hope this helps.

Force Bitbucket Commit to be associated to JIRA Ticket by Comment Formatting

The exact need is to force all commits into Bitbucket to be linked to a JIRA ticket.
I have does this before on Subversion by creating a commit hook that looked for the JIRA ticket in the commit text, but I don't want this solution to be necessarily constrained to that prior experience.
Does Bitbucket have a setting somewhere to force association for all commits against Jira tickets? If not - does it have a mechanism for enforce commit comment quality (some sort of hook or regex)? If not - does GIT have something that we can use for this purpose?
The imagined solution is (but not limited to being) a commit hook that fails the commit if the comment text does not contain a leading JIRA ticket, followed by a colon, followed by some commit text, such that:
git commit -m "foo"
fails and
git commit -m "PRJ-9327: foo"
commits...
The BitBucket issue 5658 just got implemented today (April 13th, 2017)
Option to reject commits without an issue key in their message
This feature is now available to all users via the repository settings "links" page
The pre-receive hook that rejects pushes when any commit does not have a valid issue key in its message.
The current implementation relies on the per-repository "Links" setting to determine what a valid issue key looks like. This gives us the ability to validate against Jira, Bitbucket Issues, Connect add-ons, and any configured custom Links.
So you don't need for a third-party plugin anymore.
Update (14 April 2017)
It looks like this feature has been integrated to the JIRA mainline and should be released soon. See VonC's answer for details.
Original answer
There is a number of plugins for Bitbucket that can do this. For example Commit Policy Plugin for Bitbucket (free)
Disclosure: I'm not in any way connected to the team behind the plugin I mentioned.

Bitbucket Cross Repository Issue

I am using GIT based platform working on different repository in Bitbucket. Suddenly using git, I accidentally fetch different branch from
other repository — and it says that thousands of codes were fetch. The problem is - how will it affect on my current repository.
Do i need to revert / rollback it? How?
or if I check-out to master and pull the current updated branch, will it fix?
Hoping for your immediate response.
Thanks,
No worries. Checking-out on the master and pulling back the updated branch will fix your issue.

Atlassian Jira SVN Plugin Help

I have installed Jira and the subversion plugin (with success from what i can tell from the administration panel - subv. plugin installed).
I then add a repository that I have created on the file system, BUT i cannot see an option which will link/connect a new or existing project to a SVN repository. What i want to do is link a project with a repository so I can track commits made to the project (link commits with issues). After some searching i found that this is possible but I cannot figure a way to do it.
Do I need another plugin for that? I have tried googling for the last hours but I cannot find anything related.
regards,
The way SVN-Jira linking works by default is to simply put the issue identifier of the Jira issue in the comment when committing to the SVN repository.
It can be helpful to enable comment editing in the repository, if you have past commits or users who forget to add comments when committing.
Example commit comment:
Fixed problem with login. See issue MYJIRAPROJECT-26 in issue tracker.
There's a service in Jira which scans the SVN repository at regular intervals, and builds a cache of any SVN revisions where an issue identifier appears. Depending on the polling interval, it make take a few minutes for the commit to show up in Jira.
The polling time is controlled by the JIRA Service for the SVN plugin. See Admin, Services.
~Matt
you can enforce that future subversion commits require a jira issue reference for more reliable--than relying on your programmer's word ;)--jira-subversion integration
the jira commit acceptance plugin can be configured to block commits that don't include a valid (defined by subversion-jira project mapping and/or regular expression as appropriate to your situation) jira issue reference in the commit comment
reliable jira-subversion linkage availability allows handy stuff like:
Integration with issue trackers

Resources