Configure JIRA with gmaster

Wednesday, November 15, 2017 0 Comments

You have seen it more than once. Every time you create a branch, next to the "Manual" tab -where you are stuck at-, there is a disabled "From task" tab. Yes, gmaster has supported the creation of branches from issue trackers for a long time. But no, gmaster does not have a dialog in place to configure them yet.

So, let's see how we can configure an issue tracker extension by hand.

We'll be editing your gmaster.conf file, which should be located at %LOCALAPPDATA%\gmaster\config\gmaster.conf. Remember, that %LOCALAPPDATA% might vary depending on your setup, but it is usually C:\Users\your_username\AppData\Local. Anyway, you can type %LOCALAPPDATA% in Explorer's address bar to see where it takes you.

We need to add a new section to our gmaster.conf file. Sections are declared between brackets, and everything below a section declaration, down to the next declaration, belongs to that section. The issue tracker configuration section is named Extensions, and it looks like:

[Extensions]
extension.assembly=/path/to/jiraextension.dll
extension.config=/path/to/jira.conf
  • The jiraextension.dll, if you installed gmaster using the default path location using our lightweight installer, should be located at %LOCALAPPDATA%\gmaster\bin\extensions\jira\jiraextension.dll
  • The JIRA configuration file can be wherever you want, and can be named whatever you wish. For simplicity's sake, I'll place my jira.conf file at %LOCALAPPDATA%\gmaster\config\jira.conf

With this data, my gmaster.conf's extensions section ended up looking like:

[Extensions]
extension.assembly=C:\Users\sluisp\AppData\Local\gmaster\bin\extensions\jira\jiraextension.dll
extension.confg=C:\Users\sluisp\AppData\Local\gmaster\config\jira.conf

So far, so easy! Now, we only have to fill in our jira.conf file with the data of our JIRA setup. This is the format that the jira.conf file must have:

WorkingMode=TaskOnBranch
 
Name=Host;Value=[your JIRA server URL];Type=Host;IsGlobal=True
Name=User name;Value=[you JIRA user];Type=User;IsGlobal=False
Name=Password;Value=[your JIRA password];Type=Password;IsGlobal=False
Name=Branch prefix;Value=[branch prefix];Type=BranchPrefix;IsGlobal=True
Name=Project Key;Value=[your project key];Type=Text;IsGlobal=True
Name=Issue query limit;Value=50;Type=Text;IsGlobal=False
Name=Resolved issue states;Value=Done;Type=Text;IsGlobal=True
Name=REST URL;Value=/rest/api/2/;Type=Text;IsGlobal=True
Name=Task URL;Value=/browse/;Type=Text;IsGlobal=True

There are some fields you need to change, of course. Replace the strings inside the brackets in the example with your own configuration:

  • Host: This is the URL of your JIRA server. For example, https://thisdemoisprettycool.atlassian.net
  • User name: This is the user name you use to access your JIRA server. If you use an email, you need to check your user name under your account settings, and use that instead of your email here.
  • Password: You guessed it, this is the password for your account. For now, we'll write it in plain text, but don't worry, gmaster is prepared to store and read it ciphered. Once the full issue tracker extensions support is in place, the password won't be left in plain text.
  • Branch prefix: Here at C√≥dice, we use gm, scm, and sm as the branch prefixes, depending on the project we're currently working on, but the JIRA extension only lets you configure one. The branch name will be the branch prefix + the task ID. (for example, gm003)
  • Project Key: This is the key, or short identifier of your project. You can get yours from your project's list in your JIRA dashboard.
  • Resolved issue states: You will need to modify this one if you are using a modified workflow. This "Resolved issue states" is used to hide from the pending tasks list those with the comma-separated statuses defined here. So, for example, if you don't want to see tasks that are either "Done", or, for example, "Ready for QA", you'd fill your "Resolved issue states" with "Done,Ready for QA".
  • REST URL and Task URL: Leave these unchanged!

Once you have filled in the configuration information, you can fire up gmaster, or restart it if it was already opened.

After opening the "Create branch" dialog, gmaster loads the JIRA extension and will automatically prompt you to choose one task to create your branch from.

For example, this is how my JIRA dashboard looks like now:

And this is what the "From task" tab looks like:

As you can see, you can display pending tasks from everyone, or just yours, and you can automatically mark as open the task on the issue tracker once your branch is created.

If you have any doubt, problem, or suggestion, don't hesitate to leave a comment, or ping us on Twitter at @gmasterscm.

Enjoy!

We develop gmaster, a Git GUI with semantic superpowers. It parses the code to really understand how it was refactored and then diff it and merge it as a human would do, matching methods instead of lines.

If you want to try it, download it from here.

We are also the developers of SemanticMerge and Plastic SCM, a full-featured version control.

0 comments: