Plastic SCM for JIRA

Monday, January 21, 2013 3 Comments

It’s an eternal truth that all software projects have new features and bugs. A good automated issue-tracking solution turns out to be an essential tool for every project.

Jira is an issue tracker and it helps you following the rule of thumb for every controlled project: everything you do in code must have an associated task. Whether you call them bugs, tasks, improvements or work requests, JIRA provides an efficient way to track and manage your daily work, which can have a big impact on productivity and results.

Plastic SCM integrates with Atlassian JIRA so you can get the best of the two.


How does the integration work?

Plastic SCM implements task-driven development (efficiently and intuitively), using the branch-per-task pattern.

This article will explain how to integrate JIRA and Plastic SCM and how to implement the task-driven development with them.

Installation and Setup

Jira

The first step will be downloading and installing JIRA.

Go to download page and select the distribution for your OS (Windows, Linux, Mac OS X), then follow the installation notes. You will find them on the JIRA Documentation.


Installing JIRA Standalone on Mac OS X

Since I’m using a Mac I’ll be explaining how to set it up on Version 10.6.8 but you can do almost the same on your Windows or Linux server:

  • After downloading the JIRA tar.gz file, select a good location for it and unzip it. The “JIRA Installation Directory” is the directory into which the JIRA application files and libraries have been extracted.
  • Set JIRA Home to the location of your “JIRA Home Directory”. Edit the JIRA-application.properties file and set the value of the ‘JIRA.home’ property to the desired location for your JIRA Home Directory. Atlassian recommended locating your “JIRA Home Directory” completely independently of the “JIRA Installation Directory” (i.e. not nesting one within the other)
  • Start JIRA: open a terminal window and run start-JIRA.sh in “atlassian-JIRA/bin”.
  • Open your browser and go to http://localhost:8080 and define the application properties. The JIRA setup wizard will guide you through the initial steps as you can see in the figures below:

Step 1 of 4

Step 2 of 4

Step 3 of 4

Step 4 of 4


And you're done.


Note: the version I just tried is JIRA 5.2.4.1


Plastic SCM

Go to our download page.

Installing Plastic SCM is rather simple so you’ll get it up and running in fewer than 2 minutes:

  • Make sure you downloaded the correct distribution (Windows, Linux, Mac OS X).
  • Launch the installer to begin the installation wizard:
    • By default, Plastic SCM directory is named Plastic SCM
    • The Plastic SCM configuration wizard client will show up:
      • Select the port where your Plastic SCM server will listen: 8087 by default.
      • Select the user security configuration mode, “local users” is the default.
    • In fewer than 1 minute Plastic SCM will be installed in your computer.

Note:I’m using Plastic SCM version 4.1


Integrating Plastic SCM with JIRA

Plastic SCM offers out-of the-box integration with JIRA. Setting up the connection is actually easier than explaining what’s going on (which is not difficult either).

In order to do it, go to the actions bar on the left side and then click on “Preferences”:


Then the “Preferences View” will show up, listing all the available options. Click on “Isssue Tracking” button:


The dialog has two different options:

  • Don’t bind Plastic SCM branches or changesets with any issue tracking system
  • Bind to this issue tracking system

Let’s choose the second option, and select “Atlassian JIRA” as our issue tracking system:


Plastic SCM implements two different working modes:

  • Bind issues to Plastic SCM branches (recommended). This way the link is pretty easy to set up and you’re free to embrace full parallel development using as many branches as you want. Remind, we recommend you the branch per task pattern. The branch prefix “scm” will be the link between Plastic SCM branches and JIRA issues, but you should select the one that better suits your needs.

  • Bind issues to Plastic SCM changesets. If you select this option, every changeset will be linked to a task. This is probably the more common mode for users of other version controls systems. We support it, although we strongly recommend the branch per task alternative.


The next step to ensure the extension is properly configured will be checking “JIRA server configuration settings”. Look at the figure below:


Please, pay special attention to remarked parts on the above figure:

  • Server: get the URL where the server is configured
  • Project key: it prefixes each issue in the JIRA project. It can’t be changed once the project is created. Max length is 10 characters.
  • Test connection: to check whether the connection to your JIRA server is correct. Once the button is clicked you will see a window with the result of the test: success or failure.

Getting started with JIRA and Plastic SCM: the branch per task cycle

Now, we are ready to start working.

This part is a casual introduction to JIRA and its approach to task-driven development

In JIRA you usually work with a project and its issues.

In task-driven development, changes made to individual files are grouped into higher-level structures, called tasks or issues in JIRA. Every change made to implement a new feature or fix a bug is an issue (or task).

So let’s see how to work with Plastic SCM and JIRA using task-driven development implemented through the branch-per-task pattern.


New project in JIRA

To add new project in JIRA, click “Add project” option to open “Add a new project” dialog box:


You need to enter a name (descriptive name) and key (unique key). This key will be used as the prefix of this project’s issues. If you remember, in the previous part, you entered this key value in Plastic SCM preferences window.

As you can see on the figure, I typed “Plastic SCM Learning” as the name and then “LRN” as the project key.


Create an Issue in JIRA

JIRA enables you to keep track of different types of issues: bugs, tasks, documentation, etc.

Following the branch per task pattern, everything will be a task: Every developer will work on a task, each task will be implemented on a branch and the cycle will continue until branches get merged (which will happen very, very frequently). JIRA will manage all the tasks of the project.

Let’s go to “Browse Project” view. It will look like the following:


As you can see, “Filters” option manages all the operations you can perform with an issue. Now, let’s add a new one, it’ll be a new feature. So, click on the “Create Issue” button, and then a new dialog will show up:


JIRA suggests you the value of some fields like project name, issue type, or assignee. You can modify them. Look at my example below:


As I mentioned, tasks are the cornerstones of project coordination. Each of them has a unique number, which will be key to identify them within Plastic SCM.


Create a branch in Plastic SCM

Let’s go to Plastic SCM.

Open the “Branch Explorer” view. My recommendation is that every task (branch) should start from a stable release, a secure status that you can recover later on.

To create a new branch (child branch actually) right click on your stable starting point and select the “Create branch from this changeset” action.

Task branches have a simple naming scheme:

user-defined-prefix + issue-number

user-defined-prefix: “SCM” is the prefix that we wrote in our issue tracking configuration.

issue-number: enter the name based JIRA issue number


Now, the link (between Plastic SCM and JIRA) is set automatically.


Developers will work on the task: adding new files, modifying, renaming, deleting, etc.


How does the connection with JIRA work?

Let’s see how the JIRA connection works. Go to “Branch Explorer”. Click “Options” at the top bar. A new view will open:


As you can see “Properties” is the first tab. It’ll show you all the properties of the current branch “SCM001”. You can select the others tab to discover all the others options: “Display options”, “Conditional Format”, “Replication Sources”, etc.

The last tab is “Atlassian JIRA Extension” view. Click on this option and click on refresh button to update the information.


The information panel shows the information coming from JIRA:

  • The name of the JIRA issue: Task- ID
  • The title of the issue
  • The status
  • The owner
  • The description

So, you can see how Plastic SCM associates every branch with a specific JIRA bug or new feature. The key thing is every checkin we do will go into the branch; it will associate it to the right task.

There are three options on the top of “Atlassian JIRA Extension” tab as you can see:


These options are the following, from left to right:

  • Update: updating the info.
  • Open JIRA in a browser, to see the standard information on the JIRA site. Double click on the description performs the same action.
  • Custom View: change the view.

Conclusion

In this post we showed you how task-driven development can help you to manage your work in an efficient manner and supporting agile methods. In this game, there are three main actors: tasks, JIRA (an issue tracker), Plastic SCM (our favourite DVCS).

In the brach-per-task pattern the task sits on the centre. JIRA tracks the issues (features and bugs) because every change you do in your project will have an associated task. A good automated issue-tracking solution should streamline the process of managing a software project.

Plastic SCM associates every branch to a specific issue and there is a direct connection between the branch in Plastic SCM and the task in JIRA.


3 comments:

  1. I'm just wondering if the Project Key needs to be changed in Preferences if I work on several different projects in a day.

    ReplyDelete
  2. I'm just wondering if the Project Key needs to be changed in Preferences if I work on several different projects in a day.

    ReplyDelete