larruda/dorg-to-jira

A simple PHP script to import issues from Drupal.org into a Jira project.

1.0.0 2016-12-01 01:19 UTC

This package is not auto-updated.

Last update: 2024-05-11 22:50:51 UTC


README

A simple tool/script to import issues from Drupal.org into a JIRA instance.

Build Status

Features

  • Imports title by default in the format '#1234567 This is the issue title'
  • Supports JIRA custom fields and a few available tokens for value replacement
  • Adds the project's name (module/theme) as a Label to the issue in JIRA
  • Adds an external link to the issue in JIRA referring to the issue at Drupal.org.

Installation

Download the PHAR somewhere in your filesystem and make it executable. If you want it globally available move it to a directory listed in your system's $PATH environment variable. You can optionally rename the file and remove the .phar extension, so it's more like a "real bin".

Below is an example using OSX or Linux:

curl -O https://github.com/larruda/dorg-to-jira/releases/download/1.0.0/dorg-to-jira.phar
chmod +x dorg-to-jira.phar
mv dorg-to-jira.phar /usr/local/bin/dorg-to-jira

Usage

Simply run dorg-to-jira passing along the ID (nid) of the issue at Drupal.org. You can optionally set the path of the configuration file with the -c argument. By default it looks for a config.yml in the current directory.

./dorg-to-jira.phar 1234567 [-c|--config path/to/config.yml]

It will prompt you for your JIRA password on every usage. For security purposes we don't hold passwords or accept as argument/configuration.

Configuration

This tools needs a set of configuration values in order to work. Mandatory ones are jira, user and key which are the URL to the JIRA instance, the username and project key respectively. Custom fields are optional.

jira: https://jira.company.com/
user: user@company.com
key: PROJ
fields:
  customfield_12510:
    value: DEV
  customfield_12711:
    value: %ISSUE_TYPE%

Available Tokens

You can use the following tokens as values for custom fields in the configuration file. They will be replaced by the value according to the issue being imported.

Token name description
%ISSUE_URL% The absolute URL to the issue at Drupal.org.
%ISSUE_NID% The Node ID of the issue.
%ISSUE_TYPE% The issue type (e.g: bug, feature request, etc
%ISSUE_BODY% The issue body text (can contain HTML)

Building from source

I'm assuming you have *Composer *installed and globally available on your OS. If that's not the case, follow the instructions at https://getcomposer.org. With Composer properly installed and functional, clone this repository, cd into it and download all dependencies.

git clone git@github.com:larruda/dorg-to-jira.git
cd dorg-to-jira/
composer install

After that and considering no errors have been thrown, go ahead and build the PHAR archive. If you are curious about what this executes underneath or need to debug step-by-step, read the project's composer.json.

composer run-script build-phar

You should have a dorg-to-jira.phar inside a bin/ directory in the project root. If you want it globally available in your system follow the Installation instructions.

Release History

License

Distributed under the MIT license. See LICENSE for more information.