Custom field type Creation

Hi everyone,

I am working on creating a custom field type for an issue picker, which I plan to use to create custom fields and configure them with project screens. While I have almost achieved my goal, I am encountering two bugs:

  1. JQL Filtering by Project: I am using JQL to filter issues for the dropdown, but I want it to display issues based on the specific project. For example, if I am creating an issue under Project X, it should only show issues from Project X according to the JQL. However, it is currently displaying issues from other projects as well, which is not desired.
  2. Value Display on View Screen: After creating an issue using the custom field, the value does not appear on the view screen immediately. However, once I start editing that field and choose the value, it then appears on the view screen. Ideally, the value should be visible right after creating the issue.

Any guidance or suggestions on how to resolve these issues would be greatly appreciated.

Thank you!

1 Like

Hi @ABHISHEKPIPPAL1
Let us try to debug both of your issues:

The clause project = "Project X" is the part that will show you issues from Project X.

Using it in a query:

example1: Jql: project = "Project X" AND priority = "High" would show you issues from Project X, which have priority High.
whereas,
example2: Jql: project = "Project X" OR priority = "High" would show you:

  1. all issues from Project X
    and
  2. issues across all projects which have priority High. (even ones not there in Project X).
    Inspecting your JQL looking for such operators might give you the solution.

If you can share your JQL, I might be able to help you create the right one.
Here are the JQL docs for your reference.

In short:

I can’t tell for sure without looking at the code, but it sounds like you need to manage React state properly by updating local state immediately on submission, not just relying on backend fetches or useEffect.

Details
If you’re using Forge Custom UI (React), it sounds like you’re not updating local state when the issue is created, and instead relying on useEffect to pull the value from the backend. That would explain why the value only appears after you edit the field—editing triggers a re-render or a new fetch.

To fix this, you should update local state immediately when the issue is created, while also making the API call to save the value. This ensures the UI reflects the change right away, and you’re not waiting on rehydration to show the value.

Additionally, to make the app more responsive and handle errors, you can implement an Optimistic UI approach:

  • Immediately update the local state when the user submits the field, reflecting the change instantly.
  • Show a “Saving…” indicator while the API call is in progress.
  • If the API call succeeds, the value stays updated.
  • If the API call fails, you should:
    • Revert the local state (remove the value or reset it) to keep the UI in sync with the backend.
    • Optionally, display an error message (e.g., “Failed to save. Please try again.”) to inform the user.

Just to clarify, my suggestion is for Forge Custom UI (React). If you’re using Forge UI Kit, the approach will be different, and I may not be the best person to advise on that. Let me know if you’re using Custom UI, and I’d be happy to help further!

Happy coding!

G H Mahimaanvita
Full Stack engineer