Scripts¶
You can customize Allegra to your needs using Groovy scripts. For example, you can automatically assign the agent or perform plausibility checks when you save an item.
To add or edit scripts, as the system administrator, go to Administration > Customize > Scripts.
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 issue after a change |
originalIssue |
…BINDING_PARAMS.ISSUE_ORIGINAL |
the current issue before a change |
workItemContext |
…BINDING_PARAMS.WORKITEM_CONTEXT |
the workItem context (contains also the previous two beans but they will also be 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 email submission |
fromAddress |
…BINDING_PARAMS.EMAIL_FROM_ADDRESS |
from address from email submission |
subject |
…BINDING_PARAMS.EMAIL_SUBJECT |
subject from email submission |
body |
…BINDING_PARAMS.EMAIL_BODY |
email body from email 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 |
-
You can assign a workflow activity script to state transitions in workflows.
-
You can assign a workflow guard script to state transitions in workflows. On the one hand, this limits the list of possible target states when loading an item. On the other hand, when saving, the system checks whether a state transition is allowed to take place.
-
General scripts are usually bound to a specific class name. If the system detects the existence of such a class, it is called according to its purpose.
-
Parameter scripts allow you to define data structures that can be used by other scripts or the system. This enables you to separate configuration from logic and make parameterization accessible to non-programmers.