YouTrack Server 2022.2 Help

Conditional Custom Fields

In each project, you have the ability to show specific custom fields only when a value is selected in another custom field. The most common use case is to choose which fields are shown for different issue types. However, you can add a condition to show specific fields based on the selection in any enumerated field, not just issue type.

Conditions for showing custom fields can be set independently in each project. As an administrator, you can view and update these settings for all projects. To access these settings, open the Custom Fields Settings page and switch to the Fields in Projects tab.

Conditional custom field administration

You can add a condition to any field in a project. Conditional custom fields are subject to the following limitations:

  • You can only set a condition for showing a custom field based on the selection in a custom field that stores an enum, state, ownedField, version, or build.

  • It not possible to set up chained dependencies. This means that you cannot make the visibility for a custom field dependent upon multiple levels of conditions.

Before you add a condition for showing a custom field, consider the following consequences:

  • Fields that are hidden behind a condition do not store values permanently. This means that you can't use this feature just to hide sensitive information. If you want to limit access to fields that store personal data or other sensitive information, use a private field instead. For more information, see Private and Public Issue Fields.

  • If a custom field is hidden behind a condition, you cannot set the value for the field with a workflow. If you use a workflow to manage the values in a conditional custom field, make sure that your workflows don't update fields that are hidden. You can customize the workflow to check for the condition before the change is applied.

  • If you're hiding a field that already stores data in various issues, the existing values are not removed immediately. You might want to check issues that contain values in the field you want to hide and verify the values for the field that you want to use as the condition you want to hide it. Then consider whether you think it's safe to clear the hidden values from the field after you set up the condition.

    To learn more, see Clear Hidden Values.

To set up a conditional custom field:

  1. From the Administration menu, select Custom Fields.

  2. On the Fields in Projects tab, locate the project that you want to add the condition for and expand the list of fields.

  3. Select the custom field that you want to show on a conditional basis from the list.

  4. Expand the Advanced Settings section in the sidebar.

  5. From the Show only when drop-down list, select the custom field that you want to use for the condition.

  6. From the is set to drop-down list, select one or more values.

    • When one of the values specified here is selected in an issue that belongs to the project, the conditional field is shown.

  7. If the field that is now shown on a conditional basis already stores data in one or more issues, click the Clear hidden values link and confirm this action.

Clear Hidden Values

When you set up a condition to hide a field that already stores data in various issues, the existing values are not cleared immediately. The value is stored until a user changes the value for the field that is used for the condition to any value that does not show the hidden field. This is done to prevent accidental data loss when setting up the conditions for hiding fields.

As a result, you may end up with issues where hidden values are stored but not visible.

  • Issues will still appear in search results that reference the hidden field even when the value isn't visible in the issues themselves.

  • If the hidden values are states, you might see issues that are unresolved even when the state field that is still visible is set to a resolved value.

Before you set up the condition, we recommend that you check the issues that contain values for the field you want to hide and verify the values for the field that you want to use as the condition you want to hide it. The most effective way to verify these values is to use the has attribute to find issues that currently store any value in the field that you want to hide, then modify the query to exclude issues that store the values that you want to use as the condition to hide the field. For example, if you only want to show the Browser field in issues where the value for the Type field is Bug, use the following search query:

has: Browser Type: -Bug

The search results will show you all of the issues that aren't classified as bugs that store values in the Browser field. This should help you determine whether it's safe to clear the hidden values from the field after you set up the condition.

If these hidden values are not cleared during setup, they can cause problems where search results include unexpected issues or appear as unresolved. If you encounter inconsistent behavior related to the values that are stored in a field that is hidden by a condition, use the Clear hidden values option to resolve the problem.

To clear the hidden values in a custom field:

  1. From the Administration menu, select Custom Fields.

  2. On the Fields in Projects tab, locate the project where you are experiencing problems with inconsistent issues.

  3. Select the custom field that it hidden by a condition.

  4. Expand the Advanced Settings section in the sidebar.

  5. Click the Clear hidden values link and confirm this action.

    • Values for the selected field are set to its empty value in any issue where the field is currently hidden by a condition.

Last modified: 21 September 2022