I am experiencing the problem with switching issue type when using behavior to set default description. What little I could find has not helped much (either I do not understand the code (I am a beginner) or it is suggested to use another app.
If anyone has solved this, I am hoping they can share the solution. The part I need is the logic to clear the form on issue type switch, as the main problem I have is when having a separate behavior default description for the same project's issue types (the first default description is then stuck for all issue types). I need some way to clear the description and set the new default on issue type change or be cleared if no default behavior exists for that issue type.
I am migrating from DC where the functionality works great and it would be a big hit to my users if we could no longer have it.
My code starts with this and that is where I need the clearing logic.
const descriptionValue = getFieldById("description").getValue();
// If description field is wiki markup access the content property
if (typeof descriptionValue !== "string") {
const descriptionValueContent = descriptionValue.content.toString();
if (!descriptionValueContent) {
getFieldById("description").setValue({
"version": 1,
"type": "doc",
"content": [
..........