PageRenderTime 23ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 1ms

/src/main/resources/com/onresolve/jira/groovy/canned/admin/ExampleBuiltinScript.groovy

https://bitbucket.org/sorin/jira-plugin-intellij
Groovy | 59 lines | 45 code | 13 blank | 1 comment | 0 complexity | 3245eebde4b42f62c84c81d6161871a2 MD5 | raw file
  1. package com.onresolve.jira.groovy.canned.admin
  2. import com.onresolve.jira.groovy.canned.CannedScript
  3. import org.apache.log4j.Category
  4. import com.atlassian.jira.util.ErrorCollection
  5. import com.onresolve.jira.groovy.canned.utils.CannedScriptUtils
  6. class ExampleBuiltinScript implements CannedScript{
  7. public static String FIELD_PROJECT = "FIELD_PROJECT"
  8. private static final Category log = Category.getInstance(ExampleBuiltinScript.class)
  9. String getName() {
  10. "Example script"
  11. }
  12. String getDescription() {
  13. "Script for messing around with"
  14. }
  15. List getCategories() {
  16. ["ADMIN"]
  17. }
  18. List getParameters(Map params) {
  19. [
  20. [
  21. Name:FIELD_PROJECT,
  22. Label:"Project",
  23. Description:"A useful parameter description",
  24. Type:"list",
  25. Values: CannedScriptUtils.getProjectOptions(true),
  26. ],
  27. ]
  28. }
  29. ErrorCollection doValidate(Map params, boolean forPreview) {
  30. null
  31. }
  32. Map doScript(Map params) {
  33. // Script goes here
  34. params["output"] = "<b>Something useful has just happened to project ${params[FIELD_PROJECT]}</b>"
  35. params
  36. }
  37. String getDescription(Map params, boolean forPreview) {
  38. "You clicked preview... and selected the project ${params[FIELD_PROJECT]}"
  39. }
  40. public static void main(String[] args) {
  41. log.debug ("main method")
  42. }
  43. Boolean isFinalParamsPage(Map params) {
  44. true
  45. }
  46. }