This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo source this script using . to define function below | |
echo script requires that packages 'curl' and 'jq' are installed | |
echo . upm_deploy_addon.sh | |
echo upm_deploy http://localhost:8080/jira admin:passwd path_to_addon.jar | |
upm_deploy() { | |
TOKEN=$(curl -s -I -u $2 $1/rest/plugins/1.0/|grep ^upm-token|cut -c12-|tr -d '[:space:]') | |
out=$(curl -s -X POST -u $2 -H "Accept: application/vnd.atl.plugins.installed+json" -F plugin=@$3 $1/rest/plugins/1.0/?token=$TOKEN) | |
while [ "$(echo $out | jq -r .status.done)" = "false" ]; do | |
sleep 1; echo -n . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#### | |
# extractUserAddons.sh <baseurl> <userid> <passwd> | |
# | |
BASEURL=$1 | |
USERID=$2 | |
PASSWD=$3 | |
if [ -z "$BASEURL" -o -z "$USERID" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.issue.MutableIssue | |
import groovy.sql.Sql | |
import java.sql.Driver | |
// spristupnenie customfieldu | |
def cfNumber = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Number") | |
if (cfNumber == null) { | |
return "ERROR: neznamy customfield" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'> | |
var refreshJqlHistoryPane = function() { | |
var localHistory = localStorage.getItem('jqlHistory'); | |
if(localHistory){ | |
var history = JSON.parse(localHistory); | |
var historyEntries = history.map(function(jql){ | |
var display = jql; | |
if(display.length > 25){ | |
display = display.substr(0,22) + "..."; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.component.ComponentAccessor | |
def pm = ComponentAccessor.getProjectManager() | |
def nsm = ComponentAccessor.getNotificationSchemeManager() | |
pm.getProjectObjects().each{project->nsm.removeSchemesFromProject(project)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/atlassian-jira/WEB-INF/classes/jpm.xml b/atlassian-jira/WEB-INF/classes/jpm.xml | |
--- a/atlassian-jira/WEB-INF/classes/jpm.xml | |
+++ b/atlassian-jira/WEB-INF/classes/jpm.xml | |
@@ -246,7 +246,7 @@ | |
<default-value>false</default-value> | |
<type>boolean</type> | |
<admin-editable>false</admin-editable> | |
- <sysadmin-editable>false</sysadmin-editable> | |
+ <sysadmin-editable>true</sysadmin-editable> | |
</property> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.component.ComponentAccessor | |
def cds = ComponentAccessor.getComponent(com.atlassian.crowd.embedded.api.CrowdDirectoryService) | |
def attrs = cds.findAllDirectories().find{it.isActive() && it.attributes.keySet().contains('ldap.url')}?.attributes | |
if (attrs) attrs.collect{k,v->"$k = $v"}.join("\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def p = ~/.*\.pm/ // pattern for files | |
def c = /". c ([0-9A-Za-z#]+)",/ // pattern for colour definition | |
def count = [:] // count of colours | |
// recursing into current directory | |
new File(".").eachDirRecurse { d-> | |
d.eachFileMatch(p) { f-> | |
f.eachLine { l-> | |
m = (l =~ c) | |
if (m.matches()) count[m[0][1]] = count.containsKey(m[0][1]) ? count[m[0][1]]+1 : 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.xml.XmlUtil | |
def content=new File(args[0]).getText() | |
def slurper = new XmlSlurper(false,false) | |
def prefix = """<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE ac:confluence SYSTEM "confluence.dtd"> | |
<ac:confluence xmlns:ac="http://www.atlassian.com/schema/confluence/4/ac/" xmlns:ri="http://www.atlassian.com/schema/confluence/4/ri/" xmlns="http://www.atlassian.com/schema/confluence/4/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.atlassian.com/schema/confluence/4/ac/ confluence.xsd"> | |
""" | |
def suffix = "</ac:confluence>" | |
def xml = slurper.parseText(prefix+content+suffix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: cas-get.sh {url} {username} {password} # If you have any errors try removing the redirects to get more information | |
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method) | |
DEST="$1" | |
ENCODED_DEST=`echo "$DEST" | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg' | sed 's/%2E/./g' | sed 's/%0A//g'` | |
#IP Addresses or hostnames are fine here | |
CAS_HOSTNAME=team.eea.sk | |
#Authentication details. This script only supports username/password login, but curl can handle certificate login if required | |
USERNAME=$2 |