Getting DevOps right goes beyond just implementing one practice or one tool, but rather it is a collection of best practices – on both a human level and technological front – to improve communication among and within teams. While there is no magic bullet or one-size-fits-all schemes for getting DevOps right for your specific team, automation remains one of the key aspects in completing a successful DevOps journey.
Why automation matters in DevOps
The first part to this blog addressed visibility in an Atlassian environment. In a nutshell, for teams to work smarter together, visibility is critical because it needs to be clear who is working on what branch and what work is underway.
However, automation also supports improved visibility by pushing updates in real time, which in turn decreases human errors during manual updates. This can give the team more bandwidth to concentrate on higher level tasks, as well as deflect problems before they arise.
Fortunately, the Atlassian suite provides powerful automation features which are available out-of-the-box without any additional tools or apps. Let’s take a look as to how this works.
Workflow automation triggers
Many aspects of your automation can be setup directly within your Jira workflows. For example, if we wanted to automatically transition an issue whenever a commit was made to your Bitbucket instance, we can do that by editing the Jira workflow and adding an automation trigger.
In the workflow editor, pick the transition you’d like to automate with commits. For this example, the most practical might be the transition from “Open” to “In Progress,” or whatever your equivalent statuses are.
We then select “Triggers” in the transition view, and “Add Trigger.” “Commit Created” will allow us to add this trigger to the workflow during this status. Once you’re done, you simply publish the workflow.
In order to observe the trigger at work, take the issue key of an Open/To-Do issue you’d like to transition, and plug that issue key into the commit message of your code. Commit the code, check the issue and revel in the glory of your work. You don’t have to manually transition an issue to indicate to your team that it is being worked on. The issues will update in real-time, providing improved visibility to your organization, as long as you’re using issue-keys in your commit messages to trigger the automation. It’s also important to note you can use the “Branch Created” trigger to achieve the same result if you’d like to transition issues based on branch creations.
This is just one example of a trigger that can be used to automate your workflows. It will likewise work with Github and Fisheye if you have those tools integrated with your Jira.
Utilizing workflow post functions
Post functions are also an efficient way to automate tasks that you’d rather not worry about. Utilizing post functions in tandem with your automation triggers will make you a master of your organization’s workflow.
How often do you transition an issue in Jira and then have to assign that issue to a member of another team for review, approval, or something else? If it’s often, you may sometimes forget to assign it to another user, especially when you have so many issues to keep track of. Maybe there are some issues that always get assigned to the same person by default and you’d like to have the workflow reassign the issue automatically.
Like before, we can navigate to the workflow transition we would like to edit. In the transition window, we select “Post Functions.” Then select “Add Post Function”
Then click “Update Issue Field,” and “Add.”
From here, we’re able to set which issue field we would like to automatically update on a transition. Note that the transition could even be “Create Issue.” For the purposes of our example, we can leave Assignee selected from the dropdown, and then fill in which user we would like to automatically assign the issue to once the issue is transitioned. Then click “Add” and publish the workflow.
This is useful if we want to automatically assign the issue to the user who has to review or manage the ticket. If you have a trigger set up to push code for review when you’ve committed, you can commit the code, transition the issue and assign it to the user who should review your code, all in one step.
With the Atlassian suite, it’s easy to create branches of code directly in your Jira tickets! To get started, open up a Jira issue. Assign the issue to yourself, and select “Create branch” on the right within the development pane.
You can configure several different options and you can create your branch directly from within the Jira ticket, thus allowing for more visibility and better ownership over your team’s workflow.
Crucible and Jira workflows
Much like the above, we can customize our workflows in Jira to transition issues from status to status. The steps are the same as the above.
Select the transition you’d like to edit, select triggers, and pick one of the triggers available to you. The following events are available for Crucible automation:*
- Review started
- Submited for approval
- Review rejected
- Review abandoned
- Review closed
- Review summarized
You can read Atlassian’s documentation for further information regarding this point.
Bonus tip: Integrate Hipchat into your DevOps journey
Here’s a bit of a bonus tip for all of you looking to improve visibility for your DevOps team. This example is especially potent when it comes to responding to code red issues and emergencies.
Let’s say you have an issue type in Jira dedicated to emergencies that compromise your organization’s uptime for their tools, services, products, etc. You can configure Hipchat to automatically push Jira issues to a specific chatroom and alert everyone in that chatroom that there is a problem.
To do this, navigate to the HipChat configuration options from within your Jira system settings. Select the room you’d like to notify, and click “Add.” You can then configure the options to specify which issue types will send notifications to the room, or you can use advanced configuration via JQL to specify other details.
Then, pick an action, a notification setting, and you’re done! This can also be used to notify others when issues are transitioned from status to status as well. So get creative and configure Hipchat to work for you.
The Devops journey of a thousand miles begins with one click
Atlassian products are so flexible and customizable that they really provide everything your team needs to put you on the path for DevOps success. However, at Valiantys we understand that a complete DevOps journey relies on aligning people, processes and the tools to work for the specific needs of your organization. If you need expert advice for how to implement a DevOps infrastructure for your company, don’t hesistate to click below and talk with one of our Atlassian certified consultants.