I’m trying to implement a custom field type for Jira Cloud, with a custom edit interface.
I have the manifest like this:
jira:customFieldType:
- key: custom-field-type-1
name: Custom Field Type 1
description: String
type: string
validation:
expression: value != null
errorMessage: "Validation failed"
formatter:
expression: "`${value}`"
value:
function: cft1-getValue
function: cft1-view
edit:
function: cft1-edit
The function cft1-edit points to:
const GetEdit = () => {
const onSubmit = (formValue) => {
return formValue.value;
}
const {
platformContext: {
issueId
},
extensionContext: {
fieldId,
fieldValue
}
} = useProductContext();
console.log("issueId: " + issueId);
console.log("fieldId: " + fieldId);
console.log("fieldValue: " + fieldValue);
return (
<CustomFieldEdit onSubmit={onSubmit} header="Name" width="medium" >
<Fragment>
<TextField label="Value" name="value" type="string" isRequired defaultValue="{fieldValue}" />
</Fragment>
</CustomFieldEdit>
);
}
The 3 console.log() prints correctly, but in the UI, {fieldValue} is not resolved, it shows up as a literal string.
The only custom field example I can find, Risk Assessment custom field (Bitbucket), does not display the current value in its edit interface.