Smart commits allow your team to perform actions on Jira issues from a single commit. Users can enter the issue key and the desired action such as time tracking or closing an issue. The VAEC Git Integration process supports smart commit by adding a simple syntax to a commit message.
You can:
- comment on issues
- record time tracking information against issues
- transition issues to any status defined in the Jira Software project's workflow.
A Smart Commit command must not span more than one line (i.e. you cannot use carriage returns in the command), but you can add multiple commands to the same line.
We are looking to integrate the LGY Projects with the VA GitHub Enterprise to have Commits, PRs, and other build information be automatically reflected in our Jira Issues.
Step-by-step guide
Follow these steps to begin using Smart Commits:
*Jira Project Admin: Prepare your Jira project by adding "VAjira Service" as a developer to your project.
- Create the webhook in your repo.
- Navigate to your repo and go to Settings -> Hooks and click "Add webhook"
- Copy this URL into the "Payload URL" textbox:
- https://devops.va.gov/jenkins/generic-webhook-trigger/invoke?token=d@wer#wrdfOKMwer43sd
- Change "Content type" to "application/json"
- Click the radio button "Let me select individual events."
- Only check the "Pushes" event, and nothing else.
- Click "Add webhook"
- Test the connection with a commit:
(Your commit messages must have your Jira ticket ID in the following syntax: [#TICKETID] )
- Example commit message:
git commit -m '[#ABC-123] This is an example commit message, I am done!'
Here is an example of a Smart Commit comment in Jira:
Notes
Smart Commits only support the default Jira Software issue key format. This format is two or more uppercase letters, followed by a hyphen and the issue number, for example JRA-123.
Learn more about using Smart Commits: Processing issues with Smart Commits.
Learn more about using Smart Commits: Linking Repositories
Related articles
An Atlassian Guide on how to use Smart Commits, along with examples, is linked HERE.