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:
Manifest
modules:
jira:customField:
- key: customfield-key
name: Number Custom Field
description: This custom field displays a number.
type: number
value:
function: render-number
function:
- key: render-number
handler: index.renderNumber
Functions
const calculateNumber= (field, issueId) => {
const result = { fields: { [field.id]: 5 };
return JSON.stringify(result);
};
export const renderNumber= (args) => {
return args.issues.map((issue) => calculateNumber(args.field, issue.id));
};
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.