Jira Integration
qjira - Query Jira
The qjira program uses a private ssh to encrypt the jira username and password
Create a ssh private key called mykey
Create a private key to encrypt and decrypt your jira username and password
~/.ssh$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/marc/.ssh/id_rsa): mykey Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in mykey2. Your public key has been saved in mykey2.pub. The key fingerprint is: SHA256:XuHQ0li2SilfQn7kfeZUkysrxyqgrkdSoLszdRbgqtY user@localhost The key's randomart image is: +---[RSA 2048]----+ |. oo | |.. .. | | .. =. . | |o . =0o. | |+.o . S.=. | |o.o .o =+=+ | |o= E..=+*= | |+o+ ++=+ | |*= o+. | +----[SHA256]-----+
Set Jira Password
Then enter your username and password into the jirapass command using the "write" option in the form <user>:<password>. In theis example demo:test123 was entered
~/.ssh$ jirapass -w Enter value to encrypt : ************ Confirm value to encrypt: ************ Credential jirapass written
This will store your username and password encoded and encrypted in a jirapass file in your ~/.ssh directory.
Set JIRA_SERVER
Set the JIRA_SERVER in qjira.conf file
vi scorch/etc/qjira.conf ~/scorch/etc$ cat qjira.conf JIRA_SERVER='http://jira-nas'
Run qjira
~/.ssh$ qjira -j DEP-1 Action : DEMO-GROUP ~/.ssh$ qjira -h qjira Using /tmp/scorch/bin/../etc/qjira.conf to locate the JIRA Server: http://jira-nas # Query Options -j <ticket number> Jira Ticket ID -u <user:password> # Help -h | --help Show help -v | --verbose Display version # Future features and development create, assign, transition, comment -c | --create Create a ticket -d description -s state -a assignee -set [-d -s -a] # Example qjira -t DEP-1
Behind the scenes
~/.ssh$ ls -l jirapass -rw-rw-rw- 1 user group 74 Nov 18 18:46 jirapass ~/.ssh$ cat jirapass jirapass=U2FsdGVkX1+ZdcUAq+9a3uixkVpr+7HXMLy+818FDnZaE0h4SLpZ1F4ixfhXQWPp
This encoded password can be read using the same command in "read" mode
~/.ssh$ jirapass -r ZGVtbzp0ZXN0MTIz