Getting started:
Related tutorials:
| def configuration = new org.sonatype.nexus.repository.config.Configuration() | |
| configuration.setAttributes( | |
| 'maven': [ | |
| 'versionPolicy': 'RELEASE', | |
| 'layoutPolicy': 'STRICT' | |
| ], | |
| 'proxy': [ | |
| 'remoteUrl': 'http://localhost:8000', | |
| 'contentMaxAge': -1, | |
| 'metadataMaxAge': 1440 |
Getting started:
Related tutorials:
| # Replace oauth_consumer_key with your consumer key | |
| # Replace oauth_token with your access token | |
| # Replace oauth_signature with "your_consumer_secret%26your_access_token_secret" | |
| # Note that the oauth_nonce must change and be unique for every request | |
| curl -X GET 'https://yoursite.desk.com/api/v1/account/verify_credentials.json' -H 'Authorization: OAuth oauth_version="1.0",oauth_timestamp=1321473112,oauth_nonce=937459123,oauth_signature_method="PLAINTEXT",oauth_consumer_key="nMu4u9pLRfDrxhPVK5yn",oauth_token="ivouGxpsJbyIU5viPKOO",oauth_signature="vLr9MjzowzVwbvREpWhIVQMJQI0G7Pin6KHCoXak%26igQY0L2bcbwonZTC4kG5ulZxTMTDW0K0zIyceSuF"' |
| /** | |
| * You might need to import JIRA ssl certificate into your jdk/jre cacerts file: | |
| * 1) save JIRA certificate. E.g. in Chrome right click on https icon, click "Certificate information" link. | |
| * In "Details" tab, click "Copy to File..." button. | |
| * 2) in jdk "bin" folder run: "keytool -importcert -keystore ./cacerts -file /file/from/the/step/above/cacert.crt -trustcacerts -alias jira_ca | |
| */ | |
| class JiraMain { | |
| static void main(String[] args) { | |
| // see https://docs.atlassian.com/jira/REST/latest/ | |
| def listWatchers = "https://jira/rest/api/2/issue/PROJ-123/watchers" |
| package examples | |
| import com.atlassian.jira.component.ComponentAccessor | |
| import com.onresolve.jira.groovy.canned.admin.CopyProject | |
| import org.apache.log4j.Logger | |
| def log = Logger.getLogger("com.onresolve.jira.groovy.MyScript") | |
| Thread executorThread = new Thread(new Runnable() { | |
| void run() { |
| /** | |
| * Created by Ken D: Uemura <kenduemura@gmail.com> on 6/1/2016. | |
| * | |
| * On Issue Update Event | |
| * If Component is changed and only one component is assigned | |
| * then re-assigns the issue to the Component Lead | |
| * | |
| * Tested with JIRA 6.4.11 | |
| * Set this in Add-On -> Script Lisner -> Custom Listener | |
| * |
| /** | |
| * Created by Ken D: Uemura <kenduemura@gmail.com> on 6/1/2016. | |
| * | |
| * On Issue Update Event | |
| * If Component is changed and only one component is assigned | |
| * then re-assigns the issue to the Component Lead | |
| * | |
| * Tested with JIRA 6.4.11 | |
| * Set this in Add-On -> Script Lisner -> Custom Listener | |
| * |
| /** | |
| * This script was succesfuly tested on JIRA 6.1 | |
| */ | |
| // import JIRA Component Accessor | |
| import com.atlassian.jira.component.ComponentAccessor | |
| // Create a new instance | |
| cA = new ComponentAccessor(); | |
| // Get all application users | |
| users = cA.getUserManager().getAllApplicationUsers(); |
| import com.atlassian.jira.ComponentManager | |
| import com.atlassian.jira.bc.projectroles.ProjectRoleService | |
| import com.atlassian.jira.security.GlobalPermissionManager | |
| import com.atlassian.jira.security.Permissions | |
| import com.atlassian.jira.security.roles.actor.UserRoleActorFactory | |
| import com.atlassian.jira.user.util.UserUtil | |
| import com.atlassian.jira.util.SimpleErrorCollection | |
| import com.atlassian.crowd.embedded.api.Group | |
| import com.atlassian.crowd.embedded.api.User | |
| import com.atlassian.jira.user.util.UserManager |
| package examples | |
| import com.almworks.jira.structure.api.PermissionLevel | |
| import com.almworks.jira.structure.api.StructureException | |
| import com.almworks.jira.structure.api.forest.ForestAccessor | |
| import com.almworks.jira.structure.api.forest.ForestTransaction | |
| import com.atlassian.jira.component.ComponentAccessor | |
| import com.atlassian.jira.issue.Issue | |
| import com.onresolve.scriptrunner.runner.customisers.PluginModule | |
| import com.onresolve.scriptrunner.runner.customisers.WithPlugin |