Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Forge Custom Field Function in Jira App

Abhishek Joshi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 3, 2025

I'm facing an issue with our Forge app where the function for a read-only custom field is failing. The function is defined in index.js and referenced in manifest.yml, but the app throws a error during execution. I've tried cleaning, redeploying, and debugging with forge tunnel, but the issue persists.

index.js 

 

 

import Resolver from '@forge/resolver';

const resolver = new Resolver();

resolver.define('getAbhi', async (req) => {
  console.log("Function getAbhi was called", req);
  return 'Hello Abhishek';
});

export const handler = resolver.getDefinitions();
manifest.yml

 

modules:
  jira:customField:
    - key: custom-field-hello-world
      name: custom-field-a
      description: A hello world custom field.
      type: string
      validation:
        expression: value == null || !!value.match("^[A-Za-z]+$")
        errorMessage: The value must consist only of letters
      edit:
        resource: main

    - key: editable-custom-field
      name: editable-custom-field
      description: A editable custom field custom field.
      type: string
      validation:
        expression: value == null || !!value.match("^[A-Za-z]+$")
        errorMessage: The value must consist only of letters

    - key: read-only-custom-field
      name: Read-Only-Custom-Field
      description: A Read Only custom field.
      type: string
      function: getAbhi
      readOnly: true
     

    - key: time-since-created
      name: time-since-created
      description: A time since created custom field.
      type: string
      readOnly: true
      resource:
        function: main

  function:
    - key: main
      handler: index.handler  # Same handler as above

resources:
  - key: main
    path: static/hello-world/build  # Ensure this path is correct

permissions:
  content:
    styles:
      - unsafe-inline

app:
  runtime:
    name: nodejs22.x
  id: ari:cloud:ecosystem::app/3917f6af-5993-4f31-b023-f10e7f6341bd
Note : I want to fetch the hello abhishek from index.js and want to show to read-only-custom-field . 

1 answer

0 votes
Mercy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 11, 2025

In Forge, a read‑only custom field must reference a function declared under the `function` module in `manifest.yml`, not the resolver definition directly. Your manifest defines `function: getAbhi` inside the custom field, but there’s no corresponding entry under the top‑level `function:` section—only `main` is defined there. The `function` key inside a field must point to a function module key, not a resolver method. To fix this, add a new function module block such as `- key: getAbhi handler: index.handler` under `function:` and keep your resolver definition as is. That tells Forge to expose the resolver’s `getAbhi` handler properly for use by your field.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events