Scripts#

You can customize Allegra using Groovy scripts to fit your needs. For example, you can automatically assign the responsible or perform plausibility checks when you save an item.

To add or edit scripts, go to Administration > Customize > Scripts as a system administrator.

../../_images/manageScripts1.png

There are five types of scripts:

  • Workflow activity scripts

  • Workflow guard scripts

  • Field change scripts

  • General scripts

  • Parameter scripts

The following table shows the input bindings.

Key name

Key symbol

Description

user

com.aurel.track.admin.customize. scripting.BINDING_PARAMS.BINDING_USER

the current user as TPersonBean

userID

…BINDING_PARAMS.USER_ID

the current user’s user ID

issue

…BINDING_PARAMS.ISSUE

the current item after a change

originalIssue

…BINDING_PARAMS.ISSUE_ORIGINAL

the current item before a change

workItemContext

…BINDING_PARAMS.WORKITEM_CONTEXT

the workItem context (contains also the previous two beans but they will be also directly available in the map)

project

…BINDING_PARAMS.EMAIL_PROJECT

the current workspace

errorList

…BINDING_PARAMS.ERRORLIST

the error list which should be returned in case the activity can’t be executed. The errors will be shown as validation errors

emailAttachments

…BINDING_PARAMS.EMAIL_ATTACHMENTS

attachments from e-mail submission

fromAddress

…BINDING_PARAMS.EMAIL_FROM_ADDRESS

from address from e-mail submission

subject

…BINDING_PARAMS.EMAIL_SUBJECT

subject from e-mail submission

body

…BINDING_PARAMS.EMAIL_BODY

e-mail body from e-mail submission

siteBean

…BINDING_PARAMS.SITEBEAN

TSiteBean for this Allegra instance

filter

…BINDING_PARAMS.FILTER

LDAP search filter expression

ldapmap

…BINDING_PARAMS.LDAPMAP

LDAP map from quartz-jobs.xml

The following table shows the output bindings.

Key name

Key symbol

Description

guardPassed

…BINDING_PARAMS.GUARD_PASSED

the current user’s user ID

  • Workflow Activity Scripts

    You can assign a workflow activity script to state transitions in workflows.

  • Workflow Condition Scripts

    You can assign a workflow guard script to state transitions in workflows. This restricts the list of possible target states when loading an item and checks if a state transition is allowed when saving.

  • General Scripts

    General scripts are usually bound to a specific class name. If the system detects the presence of such a class, it will call it depending on the purpose.

  • Parameter Scripts

    With parameter scripts, you can define data structures that can be used by other scripts or the system. This allows separating configuration from logic and making parameterization accessible even to non-programmers.