Hello there,
We are trying to get the value of custom field on Ui Modifications but are not receiving any change.
Here is the code we are trying on Ui Modifications :
onInit(
async ({ api, uiModifications }) => {
const select = api.getFieldById < 'com.atlassian.jira.plugin.system.customfieldtypes:textfield' > ('customfield_10046')
console.log('select', select)
}, () => {
return ['summary', 'description', 'customfield_10046'];
}
);
onChange(
async ({ api, change, uiModifications }) => {
const select = api.getFieldById<'com.atlassian.jira.plugin.system.customfieldtypes:textfield'>('customfield_10046')
console.log('select', select)
},
() => { return ['summary', 'description', 'customfield_10046'] }
);
The below code is from manifest :
modules:
jira:customField:
- key: issue-template
name: Apply Issue Template
description: Apply Templates
edit:
function: apply-issue-template
type: string
function: apply-issue-view
And here is snippet we are using to render the customField
const ApplyTemplate = () => {
const onSubmit = (formValue) => {
return formValue.template
}
return (
<CustomFieldEdit onSubmit={onSubmit} header="Select Template" width="medium">
<Fragment>
<Select label="Templates" name="template" isRequired>
<Option label="low" value="1" />
<Option label="medium" value="2" />
<Option label="high" value="3" />
</Select>
</Fragment>
</CustomFieldEdit>
);
};
Help!