Untitled conversation
- User
{ "TicketCreate": { "combinations": [ { "isEnabled": true, "fields": { "status": "2" } }, { "isEnabled": true, "fields": { "status": "5", "priority": "2" } } ] }, "TicketCreateandUpdate": { "combinations": [ { "isEnabled": true, "fields": { "priority": "3" } } ] } }
for each combination in ticket create that many times you have to create event dropdown and mapp ticket create and for each event mapp one set of fields and choices for each. 2 event dropdown, 2 sets of fields and choices
- Assistant
To implement the requirements based on the provided JSON structure for "TicketCreate", we'll create events and map the fields of each combination. Here's how you can define the event dropdowns and the corresponding sets of fields and choices:
Event Dropdowns and Mapped Fields
Event Dropdown 1: Combination 1 (Status: 2)
- Event Name: Event for Status 2
- Mapped Fields:
- Field: Status
- Choice: 2
- Field: Status
Event Dropdown 2: Combination 2 (Status: 5, Priority: 2)
- Event Name: Event for Status 5, Priority 2
- User
- Assistant
- User
no you have to include disable too
- Assistant
- User
- Assistant
- User
will this code mapp for each combination for event
- Assistant
- User
if (fieldMappings && fieldMappings.combinations.length > 0) { const fields = fieldMappings.combinations[0].fields; for (const [fieldName, fieldValue] of Object.entries(fields)) { await fieldschoosingvalues(selectedEventValue, fieldNameContainer, choicesContainer, buttonContainer, container, fieldName, [fieldValue]); } }
change to for each so that
{ "TicketCreate": { "combinations": [ { "isEnabled": true, "fields": { "status": "3", "priority": "2" } }, { "isEnabled": true, "fields": { "priority": "3" } } ] } }
for each combination you need to map fields and choices
- Assistant
- User
if (fieldMappings && fieldMappings.combinations.length > 0) { const fields = fieldMappings.combinations[1].fields; for (const [fieldName, fieldValue] of Object.entries(fields)) { await fieldschoosingvalues(selectedEventValue, fieldNameContainer, choicesContainer, buttonContainer, container, fieldName, [fieldValue]); } }
{ "TicketCreate": { "combinations": [ { "isEnabled": true, "fields": { "status": "3", "priority": "2" } }, { "isEnabled": true, "fields": { "priority": "3" } } ] } } i have 2 but you have sected 1 it should itreate for each
- Assistant
- User
- Assistant
- User
will this the function map event dropdown
- Assistant
- User
what i have asked
- Assistant
- User
- Assistant
- User
{ "TicketCreate": { "combinations": [ { "isEnabled": true, "fields": { "status": "3", "priority": "2" } }, { "isEnabled": true, "fields": { "priority": "3" } } ] } }
this is the structure now give me fixed code
- Assistant
- User
- Assistant
- User
why it merges for each combination you have to create separate event
- Assistant
- User
- Assistant
- User
not working at all
- Assistant
- User
- Assistant
- User
let ticketworkflowconditions = { "TicketCreate": { "combinations": [ { "isEnabled": true, "fields": { "status": "3", "priority": "2" } }, { "isEnabled": true, "fields": { "priority": "3" } } ] } }
now check with this
- Assistant
- User
why combinations fieldmappings
- Assistant
- User
not working at all just itereate and create event dropdown and mapp thats sit
- Assistant
- User
change combinations to fieldmappings
- Assistant
- User
- Assistant
- User
- Assistant
- User
in ui clears but in backed it appends not replaces
- Assistant
- User
ok it clears but why that value remaining
{ "TicketCreate": { "combinations": [] }, "TicketUpdate": { "combinations": [] } }
1st ticket create had values when i change to ticketupdate
why ticketcreate json ther it should run like this
{ "TicketUpdate": { "combinations": [] } }
- Assistant
- User
if (!ticketworkflowconditions[newEvent]) { ticketworkflowconditions[newEvent] = { combinations: [{ isEnabled: true, fields: {} }] };
} else { // If the event already exists, create a new combination instead of resetting the existing one const newCombination = { isEnabled: true, fields: {} }; ticketworkflowconditions[newEvent].combinations.push(newCombination); }
add this logic
if (ticketworkflowconditions[selectedEvent]) { delete ticketworkflowconditions[selectedEvent]; // Remove the entire entry console.log(
Removed ${selectedEvent} from ticketworkflowconditions.); } - Assistant
- User
just give what i asked
- Assistant