Custom Field Constraints | Targetprocess - Visual management software

Custom Field Constraints

This mashup (custom add-on) makes a custom field (Text, Drop-Down List, Date and others) required (non-blank) in either of the following cases:

  • Entity State Constraints: when an entity is moved to a specific workflow state;
  • Custom Field Constraints: when a specific value is selected in another custom field which can be Text, Drop-Down List, or Multiple Selection List.

For example, you might want to make the Resolution dropdown custom field mandatory when a Bug entity is moved to the Done state. Then the mashup will require all users to select a resolution value when they mark bugs as closed.

Or, you may introduce an Approved dropdown custom field, and make the Reason for Approval text custom field required when an entity is marked as approved.

Activation

The mashup can be activated by Administrators of your Targetprocess account. Install the mashup from the Mashups Library. Navigate Settings > Mashups menu item for this purpose.

Configure the mashup in the Code editor area.

We recommend to start with default templates, then perform small changes on them. On each edition, perform the test in order to see how your modification affects resulting behavior of the system. Make backups of the code on each edition: it will help you to revert recent changes should you break anything in the configuration.

Perform the following changes in the code, as it is shown in the picture below:

Activation

A: To configure Entity State Constraints

1) Specify a Process Name, which the custom field belongs to, as a ‘process:’ value.

2) Specify an Entity Type, which the custom field was created for, as a ‘constraints:’ value.

3) Specify an Entity State, when moving to this state in the workflow the custom field will be required, as a ‘name:’ in an ‘entityStates:’ section.

4) Specify a Name of a Custom Field, which will be required, as a ‘requiredCustomFields:’ in an ‘entityStates:’ section.

In the case where multiple custom fields are required, provide a comma separated list of custom fields.

B: To configure Custom Field Constraints

1) Specify a Process Name, which the custom field belongs to, as a ‘process:’ value.

2) Specify an Entity Type, which the custom field was created for, as a ‘constraints:’ value.

3) Specify the Name of a Custom Field, which contains the constrained value, as a ‘name:’ in a ‘customFields:’ section.

4) Specify the Constrained value, which makes a dependent Custom Field required, as a ‘valueIn:’ in a ‘customFields:’ section.

In case you need to make a custom field required, when any value except the specified one, is provided, use ‘valueNotIn’ instead of ‘valueIn’ operator.

Common actions in both cases

Click Save Mashup button.

After installation, reload Targetprocess page in your web browser. Request your colleagues to perform the same action if the mashup doesn't work for them.

Mashup in action

After the Custom Field Constraints mashup has been configured and one of actions has been triggered you will see a popup to provide the a value for required custom field:

Mashup in action

Troubleshooting

Team Workflow states are not supported so far.

Names of Entities should use origin names from Targetprocess Data Model, not customized Terms. Put names using small letters, and please remove inner spaces. For example: userstory instead of User Story, request instead of Ticket etc.

Names of Custom Fields should be provided as is. Do not remove spaces from field names.

Still have a question?

We're here to help! Just contact our friendly support team

Find out more about our APIs, Plugins, Mashups and custom extensions. Join our community of passionate users and even discuss directly with our developers.