/src/main/resources/com/onresolve/jira/groovy/canned/admin/ExampleBuiltinScript.groovy
Groovy | 59 lines | 45 code | 13 blank | 1 comment | 0 complexity | 3245eebde4b42f62c84c81d6161871a2 MD5 | raw file
- package com.onresolve.jira.groovy.canned.admin
-
- import com.onresolve.jira.groovy.canned.CannedScript
- import org.apache.log4j.Category
- import com.atlassian.jira.util.ErrorCollection
- import com.onresolve.jira.groovy.canned.utils.CannedScriptUtils
-
- class ExampleBuiltinScript implements CannedScript{
-
- public static String FIELD_PROJECT = "FIELD_PROJECT"
- private static final Category log = Category.getInstance(ExampleBuiltinScript.class)
-
- String getName() {
- "Example script"
- }
-
- String getDescription() {
- "Script for messing around with"
- }
-
- List getCategories() {
- ["ADMIN"]
- }
-
- List getParameters(Map params) {
- [
- [
- Name:FIELD_PROJECT,
- Label:"Project",
- Description:"A useful parameter description",
- Type:"list",
- Values: CannedScriptUtils.getProjectOptions(true),
- ],
- ]
- }
-
- ErrorCollection doValidate(Map params, boolean forPreview) {
- null
- }
-
- Map doScript(Map params) {
- // Script goes here
- params["output"] = "<b>Something useful has just happened to project ${params[FIELD_PROJECT]}</b>"
- params
- }
-
- String getDescription(Map params, boolean forPreview) {
- "You clicked preview... and selected the project ${params[FIELD_PROJECT]}"
- }
-
- public static void main(String[] args) {
- log.debug ("main method")
- }
-
- Boolean isFinalParamsPage(Map params) {
- true
- }
- }
-