Forge Custom Field submit fails on Create Issue screen

Hi Community!

After upgrading to the new Create Issue experience in Jira I’ve noticed that my Forge custom fields are broken

When I’m trying to submit my field, it fails with the next error in chrome console.

Is anyone have faced this issue?

Hi @belokurbohdan,

I just tested the behaviour and I could reproduce the issue when the custom field is mandatory but not when the field is optional.

Does this match the tests you performed?

With a screenshot based on the forge-risk-assessment-custom-field example when the field is in a separate tab:

The problem might be harder to identify when using separate tabs because, when the field is in the Field tab, the field required message is more visible being in the same tab:

It it true that the stacktrace of the error from the screenshot you shared matches the one I get when using the new issue create experience:

Uncaught (in promise) TypeError: t.current.querySelectorAll is not a function
    at async-engagement-messages.b7deafad750abd49ab99.8.js:50
    at r (async-engagement-messages.b7deafad750abd49ab99.8.js:4)
    at s (async-engagement-messages.b7deafad750abd49ab99.8.js:4)

But it doesn’t look like a new error and I can see the following when switching back to the previous issue create experience:

Uncaught (in promise) TypeError: t.current.querySelectorAll is not a function
    at form.js:46
    at o (final-form-focus.es.js:53)
    at u (final-form-focus.es.js:79)

I’ve raised a bug report in the meantime based on the results of my tests, but please let me know if this doesn’t match what you noticed: [JRACLOUD-78110] Creating an issue fails with required custom fields due to "Uncaught (in promise) TypeError: t.current.querySelectorAll is not a function". - Create and track feature requests for Atlassian products.

Thanks,
Caterina

Hi @ccurti

I faced with this issue, but I suppose It’s not the main reason of the problem
I don’t know is my problem connected to trace message on the first post of the topic

When I’m clicking on Save on field edit modal, an error message appeared.

Uncaught (in promise) Error: Unable to save custom field, error: Cannot read properties of undefined (reading 'trim')
    at async-atlassian-navigation.09c46dbb9a7077ac51b1.8.js:14
(anonymous) @ async-atlassian-navigation.09c46dbb9a7077ac51b1.8.js:14
DevTools

I’ve recreated all Forge Custom fields. I have not made any changes in code
Please, let me know if additional logs are needed

Thanks @belokurbohdan,

Today I managed to reproduce the Uncaught (in promise) Error: Unable to save custom field, error: Cannot read properties of undefined (reading 'trim') error as well.

I’m checking internally what might be happening and I’ll keep you posted.

Caterina

Thanks @belokurbohdan @ccurti for raising the issue.

Please let me know what kind of custom field is causing problem (e.g. ‘string’, ‘object’) and what value is returned to be stored as a custom field value.

Kamil

Hi @KamilRichert

This is a custom field type module descriptor.

  - key: cfkey-unique-selec
      name: Single Select field Example
      description: Single Select field Example
      type: string
      validation:
        expression: configuration.isRequired != null && value != null
        errorMessage: Value shouldn't be empty
      edit:
        function: singleSelectEdit
      contextConfig:
        function: defaultContextConfig
      function: singleSelectView

This field stores a string value.

Cheers,
Bohdan

1 Like

Hi @belokurbohdan I have managed to reproduce the issue. However it appears only for me when for the required field I returned undefined or null value instead of string. Could you please check if it is also a problem in your case?

Best regards, Kamil

When I remove validation section this problem disappear. I suppose something wrong with validation expressions.

Weird, the validation expression is used once you submit the whole create issue dialog, so it should not be the case. Could you please also provide the code of singleSelectEdit function?

Kamil