Versions Compared

Key

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

...

Property Name

Required

Description

Code

Yes

Work item field code. Uniquely identifies the field.

Display Name

No

Work item display name.

Description

No

Work item description.

Work Item Types

Yes

The work item types this field will apply to. In other words, if a field is assigned the “Feature” Work Item Type, then all Work Items of type “Feature” will display that field. One or more Work Item Types can be set.

Field Group

Yes

Work item field group. The group which contains the current field. The field group name will appear as a section on the work item.

Field Data Type

Yes

Work item field data type sets the visual format of the field on UI along with simple validation. For more complex validation see “Validation Script”.

The following data types are supported:

  • Text Field

  • Text Area

  • Number - UI validation will only allow integers / whole numbers

  • Decimal - UI validation will allow both integers and floating point numbers

  • Checkbox - True / False boolean field

  • Duration - Duration is the measure of time. Ui validation will only allow unit of measure formats. I.E. +2d or -3w

  • Date - UI validation expects mm/dd/yyyy format

  • DateTime - UI validation expects mm/dd/yyyy hh:mm am/pm. The date time is selectable from a calendar for ease of use.

  • URL - UI validation expects a valid URL

  • JBDCURL - UI validation expects a valid JDBC URL. See packageDeploy (JDBC) for examples of valid JBDC url.

  • Directory

  • User Select (Username or User Id) - UI provides a selection from FlexDeploy users. Value passed to the work item can be username or user id.

  • Group Select (Group name or Group ID) - UI provides a selection from FlexDeploy groups. Value passed to the work item can be name or id.

Example of how each input would display on the work item

Definition Script

No

Work item definition script. This is a groovy script to set various values like defaults or basic validations.

Example definition script to set default value for the property based on work item type:

Code Block
languagegroovy
// empty check
if (field.value == '' || field.value == null) {
   if (form.type.equalsIgnoreCase("Emergency")) {
      field.value = "Priority 1"
   }
   else  if (form.type.equalsIgnoreCase("Expedite")) {
      field.value = "Priority 2"
   }
   else  if (form.type.equalsIgnoreCase("Normal")) {
      field.value = "Priority 3"
   } else {
       field.value = "Priority 4"
   }
}

Example definition script to hide field based on another field

Code Block
languagegroovy
Hide Field based on other field value
if (form.OTHER_FIELD_CODE.equals("SOME_VALUE")) {
  field.state.hidden = true
}

List Data Script

No

Work item list data script. This is a groovy script which defines a set of options the user can choose from for this fields value. List Data Script will only apply to String based fields i.e. TextField and not DateTime.

The script is expecting one of 3 return types:

Code Block
// An array of values
return ["PROD", "NON-PROD"]

// A comma separated string
return "Break Fix,Enhancement,Problem,Project,request,Risk remediation"

// An array of ListValueDataObject
// Use the constructor or setters on the ListValueDataObject objects to set appropriate values
return [new ListValueDataObject("value1"),  new ListValueDataObject("label2", "value2"), new ListValueDataObject("label3", "value3", "Description")]


////////////////////////////////////////////////////////////////////////////////////
// ListValueDataObject has the following variables
  public ListValueDataObject(String pLabel, String pValue, String pDescription)
  public ListValueDataObject(String pLabel, String pValue)
  public ListValueDataObject(String pValue)

Validation Script

No

Work item validation script. This is a groovy script allowing for more complex validations beyond simple UI validations like isRequired or min/max value.

Example Date based Validation script:

Code Block
languagegroovy
// Validation script must return or true or false
// ValidationMessage is a variable specific to this script which will be display on the UI if this script returns false
if (form.PLANNEDSTART != null && form.PLANNEDEND != null) {   
  if (form.PLANNEDEND.before(form.PLANNEDSTART)) {
    ValidationMessage = "Planned end date is not before start date "
    return false
  }
}
return true

This script is executed when the status of a work item is changed. Status change will not go through if the validation script fails.

...

Objects

Type

Description

form

java.util.Map

Allows access to other property in the field i.e. title, keynamefields value and work item value for title, description, status, value, etc..

field

Set field value or definition valuestype, assignee and tags

field

flexagon.fd.model2.pojo.common.FieldDataObject

Set current field value and override properties value for required, hidden, disabled, maxValue, minValue and precision.

currentUser

flexagon.fd.model2.pojo.common.CurrentUser

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

FLEXDEPLOY

flexagon.fd.services.groovy.functions.IFlexDeployFunctions

Functions for performing actions in FlexDeploy.

EMAIL

flexagon.fd.services.groovy.functions.EmailFunctions

Functions for formatting and sending emails.

REST

flexagon.fd.services.groovy.functions.RestFunctions

Object exposing REST functions. For more info see Using the REST object.

TOPOLOGY

flexagon.fd.services.groovy.functions.TopologyFunctions

Allows access to Integration Accounts(such as Source Control, Change Management, Cloud, or other tools) properties.

Variables for the form object

Variables

Type

Description

form.titleTitle

java.lang.String

Returns the value of the field Title for the work item.

form.descriptionDescription

java.lang.String

Returns the value of the field Description for the work item.

form.changeField

java.lang.String

Property key name of changed field for the current work item, available when one field value is changed.

form.status

java.lang.String

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

form.typeWork item

type java.lang.String

Returns the value of the field 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

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

form.assignee

java.lang.String

Returns the value of the Assignee for the work item.

Updating state or value of field from Groovy script.

Method

Description

public Long getUserId()

Returns the user id as type Long.

getUserName()

Returns the username as a String.

getFirstName()

Returns the first name as a String.

getLastName()

Returns the last name as a String.

getEmail()

Returns the email as a String.

getRoles()

Returns the roles as a list of String.

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.valueReturns

java.io.Serializable

Updates the current field value

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

Returns the value of the 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

Returns the value of the 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

Return the value of the 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

Return the value of the java.lang.Long

Overrides the current field maxValue property. Integer.

Code Block
languagegroovy
  field.state.maxValue = 10000

field.state.minValueReturn the

value of the minValue property. Integer.java.lang.Long

Overrides the current field minValue property.

Code Block
languagegroovy
  field.state.minValue= 100

field.state.precision

Return the value of the precision property. Integer.

Methods for the currentUser object

java.lang.Long

Overrides the current field precision(Max Length) property.

Code Block
languagegroovy
  field.state.precision= 255