What is a Smart 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. Atlassian’s Guide on how to use Smart Commits, along with examples, is linked HERE.
Steps to begin using Smart Commits on VAEC GitHub Enterprise Server
* Jira Project Admin: Prepare your Jira project by adding “VAjira Service” as a developer to your project.
- Create the webhook in your repository.
- Navigate to your repository and go to Settings -> Hooks and click “Add webhook”
- Please see the following guide for the “Payload URL” information:
- 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!'
Steps to begin using Smart Commits on GitHub Enterprise Cloud
To integrate a Jira Project with a GitHub repository within the Department of Veterans Affairs organization submit a DOTS ticket with name of the Jira Project and GitHub repository URL.
Once the DOTS ticket is closed, users can simply reference the Jira ticket ID in the commit message, issue title, or pull request title for them to be linked as outlined here.
Enabling Jira Links in GitHub
In order for your Jira references in GitHub to show as links, a GitHub repository administrator will need to do the following:
- Navigate to the settings of the repository
- Select
Autolink references
in the right menu pane - Fill in the Jira project Key in the
Reference prefix
field - Fill in the Jira URL for browsing a Jira ticket in the
Target URL
field - Select
Add autolink reference
- Any linked Jira issues will now become hyperlinks in the repository’s commit messages, issues, and pull requests.
Here is an example of what a Smart Commit comment in Jira looks like:
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