jira_import
is a Perl script that, using the JIRA::REST CPAN module,
reads rows from a tab-delimited file and makes entries into your worklog
in JIRA.
Download from the download page.
cd /where/you/downloaded
mkdir -p ~/bin
test -e jira_import.dms && mv jira_import.dms ~/bin/jira_import || \
mv jira_import ~/bin/
chmod 755 ~/bin/jira_import
You can download using your browser, or by copying the jira_import
link under
"Assets" on the download page, and using wget to fetch it. e.g. to download
version 2.3.0:
wget https://github.com/ggruen/jira_import/releases/download/v2.3.0/jira_import
If you don't have cpanm, install "cpanminus" using your system's package manager, e.g.:
sudo apt-get -y install cpanminus
Then:
git clone https://github.com/ggruen/jira_import.git
cd jira_import
cpanm --sudo --installdeps . # Drop --sudo if you install locally
./install
You can then cd .. && rm -rd jira_import
if you like, or keep the
directory so that you can upgrade later.
Add a line like this to ~/.netrc
, replacing words in all caps with
appropriate values:
machine JIRA_INSTANCE login USERNAME password PASSWORD
Example:
machine something.atlassian.net login joe password mypass
To get your JIRA username, log into JIRA in a browser, click your profile picture, and select Profile. Your username is on the left side under your profile picture. The API username is not the same username you use to log into the web site.
Make a tab-delimited file like this, saved as "timesheet.txt":
Day Hours JIRA Code Task Note Producer
1 1.5 ABC-123 Broke stuff.
1 2 ABC-234 Fixed stuff.
Import the timesheet (replace JIRA_INSTANCE
with your jira domain)
jira_import -f timesheet.txt -m JIRA_INSTANCE
Go look in JIRA!
You'll probably want to put that command in a cron job to run at the end of the day.
perldoc jira_import
jira_import
relies on JIRA::REST
, which is packed into a single script
using fatpack.
To set up for development:
git clone https://github.com/ggruen/jira_import.git
cd jira_import
cpanm --sudo --with-develop --installdeps . # Drop --sudo if you install locally
If you don't have cpanm
you can install
it or use
cpan install
instead and install the modules in "cpanfile" yourself.
Make changes
vi jira_import.pl
Make a new release copy of the script
make # Creates fatpacked "jira_import" script
Install your release copy in ~/bin/jira_import
cp jira_import ~/bin/jira_import
or
make install
Since you have the dependencies installed, you can install just the script:
cp jira_import.pl ~/bin/jira_import && chmod 755 ~/bin/jira_import
or
./install
make
- Go to
https://github.com/ggruen/jira_import/releases
- Click "Draft a new release"
- Fill in the blanks and upload the
jira_import
thatmake
made - Set the tag in the github interface (it'll be pulled down - won't go the other way)
make clean