Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,625
Community Members
 
Community Events
176
Community Groups

how to get Jira ticket number when export commit log

I have been tasked with pulling the full commit history for all repositories. The resulting file will be audited by an external and internal auditors. They are requesting the commit log should have repository name, commit date, commit message, branches information, and Jira ticket number so that they can categorized and track the log via Jira tickets.
The way I did now is running the git log below:
git log --branches --tags --remotes --full-history --date-order --format='%ai %an <%ae> %h %f %d' --output commits.csv
which includes most of the information I need except Jira ticket. Is there anyway to get the Jira ticket number?
By the way, I tried to create an API but the token is not working

Thanks in advance for your help!

1 answer

0 votes

Hey @Scarlett Zhao 

git commits are not aware of Jira, or any other ticketing system. From my personal experience, there are branch name conventions and sometime commit message conventions which contain the Jira ticket. This way, BB knows how to connect the PR to relevant Jira ticket.

If you are using some convention which includes the jira ticket, you could parse it out. 

If you are not using a convention or have commits which don't align with a convention, you might need to do some backward fixing (re-writing the message to include the Jira id).

Recently I've learned that Bitbucket has a feature of commit comment (not the commit message). You might be able to use it for backward fixing without re-writing git history.   

Hope that helps.

Hi Erez,

Thank you so much for your reply. Yes I think you are right. If the developer adds Jira ticket number when they commits, Bitbucket will automatically link the commits to Jira ticket, which can be parse it out

Would it be possible if you could give me some advice on how to re-write the git history or how to use commit comment? 

Much appreciated for your help! Thanks!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events