Page tree
Skip to end of metadata
Go to start of metadata

Most of the provided examples use some base groovy classes and utilities located in separate groovy files. Thanks to using them, our examples are less complex and show the quality details necessary in real projects. It is not required to use them, however, you may find them useful while organizing your code.

Our examples are using:

ClassPackageDescription
ConfigUtilsglobal/config/ ConfigUtils.groovyAllows externalizing configuration in properties or groovy files. It also supports the loading of the environment-specific configuration.
FieldUtils

global/fields/ FieldUtils.groovy

Allows getting references to JIRA fields - the system and the custom ones, based on their code or id. Thanks to that, you can use constants located in enumerations like CustomFieldCode and SystemFieldId. Internally it uses ConfigUtils to externalize settings for specific custom fields ids depends on the environment.

CustomFieldCodeglobal/fields/ CustomFieldCode.groovyEnumeration for JIRA custom field codes. Thanks to that, you can track custom fields references in the scripts code.
SystemFieldIdglobal/fields/ SystemFieldId.groovy

Enumeration for JIRA system field codes. Thanks to that, you can track system fields references in the scripts code.

BaseDecisionTableWorkflowFunctionexample/decisiontable/ BaseDecisionTableWorkflowFunction.groovy

Base class supporting the implementation of workflow operations (post-function, validator, condition). It provides IssueFieldOperator instance and basic exception handling and logging.

BaseFieldOperatorWorkflowFunctionexample/decisiontable/ BaseFieldOperatorWorkflowFunction.groovy

Base class which is an extension of BaseDecisionTableWorkflowFunction. It additionally provides an instance of DecisionTableManager. That class is directly used as a base class in example scripts.

BaseFieldOperatorBehaviorsexample/decisiontable/ BaseFieldOperatorBehaviors.groovy

Base class supporting the implementation of field behaviors. It provides IssueFieldOperator instance and the additional helpers.

BaseDecisionTableBehaviorsexample/decisiontable/ BaseDecisionTableBehaviors.groovy

Base class which is an extension of BaseFieldOperatorBehaviors. It additionally provides an instance of DecisionTableManager. That class is directly used as a base class in example scripts.

BasicFieldBehaviorOperatorexample/decisiontable/ BasicFieldBehaviorOperator.groovy

Illustrative helper class for field operations in Script Runner Behaviors scripts. It provides additional logic for a simple form fields setup.

OptionFieldBehaviorOperatorexample/decisiontable/ OptionFieldBehaviorOperator.groovy

Illustrative helper class for field operations in Script Runner Behaviors scripts extends BasicFieldBehaviorOperator. It provides the simplified operations related to setting allowed options, like auto-clear selected options when users cannot see them or auto-select the first possible option.

Attachments

If you want to use groovy superclasses and utilities, remember to update using packages.


BaseDecisionTableBehaviors.groovyBaseDecisionTableWorkflowFunction.groovyBaseFieldOperatorBehaviors.groovyBaseFieldOperatorWorkflowFunction.groovyBasicCall.groovyBasicConcepts.groovyBasicFieldBehaviorOperator.groovyOptionFieldBehaviorOperator.groovySystemFieldId.groovyConfigUtils.groovyCustomFieldCode.groovyFieldUtils.groovy

  • No labels