Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Definition, List Data, and Validation Script have access to the following variables and methods which can used to retrieve values of other fields, set the value of the current field, and other functions to achieve your business requirement.

ObjectsVariables

Type

Description

form

see details below in form section

Allows access to form details displayed on work item page. For example, field values and work item details like title, description, status, type, assignee and tags.

field

see details below in form section

field section

Represents current field value and allows for override of required, hidden, disabled, maxValue, minValue and maxLength.

currentUser

flexagon.fd.model2.pojo.common.CurrentUsersee details below in field section

currentUser

Returns CurrentUser object with methods - getUserId(), getUserName(), getFirstName(), getLastName(), getEmail() and getRoles()

FLEXDEPLOY

flexagon.fd.services.groovy.functions.IFlexDeployFunctions

Provides various methods to retrieve data from FlexDeploy.

EMAIL

flexagon.fd.services.groovy.functions.EmailFunctions

Functions for formatting and sending emails.

REST

flexagon.fd.services.groovy.functions.RestFunctionsemails.

REST

Object exposing REST functions. For more info see Using the REST object. You can use this to invoke external systems for gathering details and/or validations.

TOPOLOGY

flexagon.fd.services.groovy.functions.TopologyFunctions

Allows access to Integration Accounts (such as Source Control, Change Management, Cloud, or other tools) properties. You can use this in conjunction with REST function to invoke external systems APIs.

...

Variables

Type

Description

form.title

java.lang.String

Returns the value of the Title for the work item.

form.description

java.lang.String

Returns the value of the Description for the work item.

form.changeField

java.lang.String

Code for changed field, available when one field value is changed.

form.status

java.lang.String

Returns the value of the Status name for the work item.

form.type

java.lang.String

Returns the value of the Type code for the work item.

form.tags

java.util.List

Returns the value of the Tags for the work item.

form.<keycode>java.io.Serializable

depends on field data type

String, Long, Double, Boolean, Date, Timestamp

<keycode> represent code of specific field. All fields field values of work item can be referenced this way.

form.assignee

java.lang.String

Returns the username for Assignee for the work item.

...

Variables

Type

Description

field.name

java.lang.String

Returns the current field name.

field.datatype

java.lang.String

Returns the current field data type.

field.value

depends on field data type

String

, Long

, Double

, Boolean

, Date

, Timestamp

Update the current field value by assigning new value as necessary. Obviously field.value represent current value of the field as well.

Code Block
languagegroovy
if (field.value == '' || field.value == null) 
{
   if (form.type.equalsIgnoreCase("Emergency")) 
   {
      field.value = "Priority 1"
   }
   else 
   {
     field.value = "Priority 2"
   }
 } 

field.state.required

java.lang.Boolean

Overrides the current field required property. True or False.

Code Block
languagegroovy
if (form.DOWN_TIME_REQUIRED!= null &&  form.DOWN_TIME_REQUIRED== true) 
{
    field.state.required = true;
} 

field.state.disabled

java.lang.Boolean

Overrides the current field disabled property. True or False.

Code Block
languagegroovy
if (field.value != '' && field.value != null) 
{
    field.state.disabled = true;
}

field.state.hidden

java.lang.Boolean

Overrides the current field hidden property. True or False.

Code Block
languagegroovy
// Hide field based on other field value.
if (form.VENDOR_NOT_FOUND != null &&  form.VENDOR_NOT_FOUND == false) 
{
      field.state.hidden = true      
}  
 

field.state.maxValue

java.lang.Long

Overrides the current field maxValue property.

Code Block
languagegroovy
  field.state.maxValue = 10000

field.state.minValue

java.lang.Long

Overrides the current field minValue property.

Code Block
languagegroovy
  field.state.minValue = 100

field.state.maxLength

java.lang.Long

Overrides the current field maxLength property.

Code Block
languagegroovy
  field.state.maxLength = 255