Skip to content

Instantly share code, notes, and snippets.

import com.atlassian.jira.bc.JiraServiceContextImpl
import com.atlassian.jira.bc.filter.SearchRequestService
import com.atlassian.jira.bc.portal.PortalPageService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.permission.GlobalPermissionKey
import com.atlassian.jira.permission.GlobalPermissionType
import com.atlassian.jira.portal.PortalPage
import com.atlassian.jira.sharing.SharePermissionImpl
import com.atlassian.jira.sharing.SharedEntity
import com.atlassian.jira.sharing.search.SharedEntitySearchParametersBuilder
package examples.usermgr
import com.atlassian.jira.bc.JiraServiceContextImpl
import com.atlassian.jira.bc.group.GroupRemoveChildMapper
import com.atlassian.jira.bc.group.GroupService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.opensymphony.workflow.loader.WorkflowDescriptor
/* CONFIGURABLE SECTION */
package com.onresolve.jira.groovy.jql
import com.atlassian.jira.JiraDataType
import com.atlassian.jira.JiraDataTypes
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.jql.operand.QueryLiteral
import com.atlassian.jira.jql.query.QueryCreationContext
import com.atlassian.jira.user.ApplicationUser
package com.onresolve.examples.xhtml
import com.atlassian.confluence.content.render.xhtml.*
import com.atlassian.confluence.content.render.xhtml.migration.UrlResourceIdentifier
import com.atlassian.confluence.content.render.xhtml.model.resource.DefaultEmbeddedImage
import com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.AttachmentResourceIdentifier
import com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.ResourceIdentifier
import com.atlassian.confluence.content.render.xhtml.storage.embed.StorageEmbeddedImageMarshaller
import com.atlassian.confluence.content.render.xhtml.storage.embed.StorageEmbeddedImageUnmarshaller
import com.atlassian.confluence.content.render.xhtml.storage.resource.identifiers.DelegatingResourceIdentifierMarshaller
package examples.docs
import com.atlassian.applinks.api.ApplicationLink
import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType
import com.atlassian.jira.issue.Issue
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.sal.api.net.Request
import com.atlassian.sal.api.net.Response
import com.atlassian.sal.api.net.ResponseException
@jechlin
jechlin / ReopenSubtasks.groovy
Created January 8, 2014 21:17
repoen subtasks
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.onresolve.jira.groovy.canned.utils.WorkflowUtils
def issue = issue as Issue
// ---------------- CONFIGURE THIS --------------------------
def actionId = 3 // action ID to reopen a subtask
// ----------------------------------------------------------
@jechlin
jechlin / gist:2629735
Created May 7, 2012 19:04
prevent non admins editing the dashboard
(function($){
$(function(){
$.get(AJS.params.baseURL + "/rest/auth/1/session", function (data) {
userName = data.name;
// check groups
$.get(AJS.params.baseURL + "/rest/api/2.0.alpha1/user", {username: userName, expand: "groups"}, function (data) {
var groups = data.groups;
var groupItems = jQuery.map(groups.items, function (val, j) {return val.name});
package com.onresolve.jira.groovy.jql
import com.atlassian.jira.JiraDataType
import com.atlassian.jira.JiraDataTypes
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.operand.QueryLiteral
import com.atlassian.jira.jql.query.QueryCreationContext
import com.atlassian.jira.timezone.TimeZoneManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.util.MessageSet
package examples
import com.atlassian.greenhopper.model.validation.ErrorCollection
import com.atlassian.greenhopper.service.rapid.view.RapidViewService
import com.atlassian.greenhopper.web.rapid.view.RapidViewHelper
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
@WithPlugin("com.pyxis.greenhopper.jira")
import com.atlassian.greenhopper.service.sprint.Sprint
import com.atlassian.greenhopper.service.sprint.SprintManager
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
@WithPlugin("com.pyxis.greenhopper.jira")