Setting number custom field value with value function

I’m trying to use the new value function ability of Forge custom fields.
I’m trying to set a number field, but everytime I do, I get the error

The field value must be a number.

shown in the UI.

Here is my code:


    - key: customfield-key
      name: Number Custom Field
      description: This custom field displays a number.
      type: number
        function: render-number
    - key: render-number
      handler: index.renderNumber


const calculateNumber= (field, issueId) => {
  const result = { fields: { []: 5 };
  return JSON.stringify(result);

export const renderNumber= (args) => {
  return => calculateNumber(args.field,;

I am unsure what exactly the return value of a value function is supposed to be. I tried both: with and without JSON.stringify and neither worked.

1 Like

Hi @MaxGroe, thank you for reaching out and for your feedback regarding documentation.

From the docs:

The function receives a list of issue IDs and returns a list of values for those issues. The values returned must be compatible with the format expected by the Edit Issue REST API operation. For example, for users the value must be an object that contains accountId.

For a number field it should look like below:

export const renderNumber = (args) => {
  return => calculateNumber(args.field,;

const calculateNumber = (field, issueId) => {
  return 5;

We will improve an example in our documentation. Once again, thank you for the feedback!


Thank you so much! @ljarzabek