Hello, here is my simple code :
——–
import React, { useState } from ‘react’;
import { view } from ‘@forge/bridge’;
const App = () => {
const [fields, setFields] = useState({ summary: ‘’, description: ‘’ });
const [err, setErr] = useState(null);
const getValuesFields = async () => {
try {
const context = await view.getContext();
const { summary, description } = context.extension?.issue?.fields || {};
setFields({
summary: summary || '',
description: description || '',
});
} catch (err) {
setErr('Error : ' + err);
}
};
return (
<div>
<button onClick={getValuesFields}>Display Values</button>
<p> summary : {fields.summary || <i>No Summary</i>}</p>
<p>Desc : {fields.description || <i>No Description</i>}</p>
{err && <p style={{ color: 'red' }}>{err}</p>}
</div>
);
};
export default App;
————
- servicedesk/customer/portals request
- Forge custom ui
- jiraServiceManagement:portalRequestCreatePropertyPanel
- Native Form
When I click on the button I want to display or retrieve the data entered before sending (beforre submit).
In my case I receive nothing ?