DisplayConditions on Custom Fields in the create Issue View ignored

Hello Everybody!

I am new to Forge and I really like it so far. But there is one problem which I cannot solve.

I have created a Custom Field with the following displayConditions:

The problem is that this custom field is still showing up on every Issue Type in the create Issue View . The Issue Detail View works and the field is not shown there if not a Story or Epic.

Is there a way to fix this?

Another Question: This field is mandatory in the create Issue View, is there a way to make it optional only with Forge and the API or do i have to configure this field in the Jira Webapp?

Thanks im advance.

Best regards

Mathias

Hello @MathiasHausleithner,

Display conditions for custom fields can only control visibility on the issue view. If you need anything more, you need to properly configure screens and screen schemes.

You can use the validation expression to control whether a field is required or not. For example, this essentially makes the field required everywhere:

jira:customFieldType:
  - key: field-key
    name: Field name
    ...
    validation:
      expression: value != null
      errorMessage: This field is required

You can make the condition in the validation expression as elaborate as you like using the full power of Jira expressions.

However, if the field is configured as required in the field configuration, there is no way to override it.

Hope this helps, let me know if you have any more questions :slight_smile:

Thank you @kkercz for your quick reply!

I am still not sure if I understand this matter completely. My Forge App has two custom fields right now:

The first custom field was required by default and was already in the default Screen Scheme included. The second custom field was not included in the default Screen Scheme and was not required after adding it.

What should the default behaviour be, when you add a Custom Field via Forge? Should they be required by default and included in the Screen Scheme?

If I publish the Plugin and someone wants to install it, do they have to modify their screen schemes in order for it to work properly? Is there a way setup this schemes once when the plugin gets installed?

Thank you in advance!

Best regards,
Mathias Hausleithner

After you first install your app, the fields are not supposed to be configured anywhere. They just become available on the list of all custom fields, and the admin needs to add them to screens etc. I’m surprised that you’re saying your field was required anywhere by default. Are you able to reproduce this with a fresh app?

Your app can configure screens automatically using the REST API, after it has received the app installation callback.

1 Like

A post was split to a new topic: entityPropertyExists currently not working on Confluence