Jira

Server Maintenance
Service: service jira stop service jira start service jira restart

Log files: /opt/atlassian/jira/logs/

Application Installation
Documentation:
 * JIRA Installation and Upgrade Guide - JIRA 6.3 EAP - Atlassian Documentation - https://confluence.atlassian.com/display/JIRA/JIRA+Installation+and+Upgrade+Guide

Download and install: cd /opt/ wget http://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-6.2.5-x64.bin sh ./atlassian-jira-6.2.5-x64.bin

Custom Install Jira Installation - /opt/atlassian/jira Jira Data - /var/atlassian/application-data/jira Ports - HTTP: 8080, Control: 8005 Service - yes

MySQL Database Configuration
Documentation:
 * Connecting JIRA to a Database - JIRA 6.3 EAP - Atlassian Documentation - https://confluence.atlassian.com/display/JIRA/Connecting+JIRA+to+a+Database
 * Connecting JIRA to MySQL - JIRA 6.3 EAP - Atlassian Documentation - https://confluence.atlassian.com/display/JIRA/Connecting+JIRA+to+MySQL

Install mysql: yum install mysql-server service mysqld start chkconfig mysqld on

mysql -u root mysql> CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin; mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on jiradb.* TO jiradb@'%' IDENTIFIED BY 'jiradb'; mysql> flush privileges; mysql> SHOW GRANTS FOR jiradb;

If you want to clear mysql users: mysql> use mysql mysql> truncate user; mysql> truncate host; mysql> grant all on *.* to root@'%' with grant option; mysql> flush privilges;

Increase System Resources
/opt/atlassian/jira/bin/setenv.sh JVM_SUPPORT_RECOMMENDED_ARGS="-Datlassian.plugins.enable.wait=300"
 * 1) JVM_SUPPORT_RECOMMENDED_ARGS=""

JVM_MINIMUM_MEMORY="768m"
 * 1) JVM_MINIMUM_MEMORY="384m"

JVM_MAXIMUM_MEMORY="2048m"
 * 1) JVM_MAXIMUM_MEMORY="768m"

JIRA_MAX_PERM_SIZE=512m
 * 1) JIRA_MAX_PERM_SIZE=384m

MySQL Database Connector
Documentation:
 * Connecting JIRA to MySQL - JIRA 6.3 EAP - Atlassian Documentation - https://confluence.atlassian.com/display/JIRA/Connecting+JIRA+to+MySQL

MySQL Connector/J JDBC driver v5.1 - http://dev.mysql.com/downloads/connector/j

cd /opt/ wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.30.zip unzip mysql-connector-java-5.1.30.zip cp mysql-connector-java-5.1.30/mysql-connector-java-5.1.30-bin.jar /opt/atlassian/jira/lib/ service jira restart

Installation Wizard
Now access the server installation wizard: http://myserver:8080/

init.d
For reference - /etc/init.d/jira (dead simple):
 * 1) !/bin/bash


 * 1) chkconfig: 2345 90 60

cd "/opt/atlassian/jira/bin"
 * 1) JIRA Linux service controller script

case "$1" in   start)        ./start-jira.sh        ;;    stop) ./stop-jira.sh       ;; *)       echo "Usage: $0 {start|stop}"        exit 1        ;; esac

SSL Proxy
Documentation:
 * Integrating JIRA with Apache using SSL - JIRA 6.3 EAP - Atlassian Documentation - https://confluence.atlassian.com/display/JIRA/Integrating+JIRA+with+Apache+using+SSL

server.xml:   

Gmail SMTP
Configuring JIRA's SMTP Mail Server to Send Notifications - JIRA 6.3 EAP - Atlassian Documentation - https://confluence.atlassian.com/display/JIRA/Configuring+JIRA%27s+SMTP+Mail+Server+to+Send+Notifications



cd /opt/atlassian/jira mv atlassian-jira/WEB-INF/lib/mail-1.4.5.jar lib/ mv atlassian-jira/WEB-INF/lib/activation-1.1.1.jar lib/

CC Field
How to use a Multi User Picker CC: Field to mimic adding "watchers" on issue creation.

1. Add a Multi User Picker custom field. We called ours CC: on http://support.atlassian.com.

http://www.atlassian.com/software/jira/docs/latest/customfields/addcustomfield.html

2. Add this to the default screen (or whichever screen you are using for issue creation).

3. Add this field in your project's permission scheme (e.g. Browse Projects, Add Comments, etc.) so the users added to CC: have the ability to view/comment on the issue.

4. Add this CC: field to your project's notification scheme so the users are notified on issue creation, update, comment, etc.

http://www.atlassian.com/software/jira/docs/latest/notification_schemes.html

Source:
 * [JRA-5493] Ability to add watchers during issue creation - Atlassian JIRA - https://jira.atlassian.com/browse/JRA-5493?focusedCommentId=141590&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-141590

python jira
pip install jira

See also Python/Jira

python JIRA

 * 1) pip install JIRA

from jira.client import JIRA

options = { 'server': 'https://jira.oeey.com' } jira = JIRA(options=options, basic_auth=('kenneth', 'password'))   # a username/password tuple

issues = jira.search_issues('status != Closed AND status != Done AND assignee = currentUser ORDER BY updated DESC, key DESC')

for issue in issues: print issue, "-", issue.fields.summary, "-", issue.fields.updated.split('T')[0]

import urllib import requests import xml.etree.ElementTree as ET

def query(query, server='https://jira.oeey.com', user='kenneth', pw='password'): jql_query = urllib.quote(query) query_url = (server + '/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=' + jql_query) req = requests.get(query_url, auth=(user, pw)) req.raise_for_status text = req.text.encode('ascii', 'ignore') root = ET.fromstring(text) return [x.text for x in root.findall("./channel/item/key")]

print query("text ~ 'some text'")

API
JIRA REST APIs - Atlassian Developers - https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis

Agile API
JIRA Software REST API Reference - https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0

Rename Sprint
Haven't found a way to rename a completed sprint from the GUI

https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/sprint-updateSprint


 * 1) !/bin/bash

USERNAME="username" PASSWORD="password" URL="https://jira.oeey.com" SPRINTID="111" NEW_SPRINT_NAME="New Sprint Name" NEW_START_DATE="8/Aug/16 8:00 PM" NEW_END_DATE="9/Aug/16 1:18 PM"

curl -i -u$USERNAME:$PASSWORD "$URL/rest/greenhopper/1.0/sprint/$SPRINTID" -X PUT -H 'Accept: application/json, text/javascript, */*; q=0.01' \ -H 'Accept-Language: pl,en-us;q=0.7,en;q=0.3' -H 'Connection: keep-alive' -H 'Content-Type: application/json; charset=UTF-8' \ --data "{\"name\":\"$NEW_SPRINT_NAME\",\"startDate\":\"$NEW_START_DATE\",\"endDate\":\"$NEW_END_DATE\"}"

Delete Sprint
Haven't found a way to delete a completed sprint from the GUI

https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/sprint-deleteSprint


 * 1) !/bin/bash

USERNAME="username" PASSWORD="password" URL="https://jira.oeey.com" SPRINTID="111"

curl -i -u$USERNAME:$PASSWORD "$URL/rest/greenhopper/1.0/sprint/$SPRINTID" -X DELETE -H 'Accept: application/json, text/javascript, */*; q=0.01' \ -H 'Accept-Language: pl,en-us;q=0.7,en;q=0.3' -H 'Connection: keep-alive' -H 'Content-Type: application/json; charset=UTF-8'