Skip to content

Commit

Permalink
Fix for missing ticket_data.SLA -> default to Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ammopt committed Sep 10, 2024
1 parent dbc0bc9 commit 158537c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rt_data_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ async function create_ticket_obj(
[column_headings[12]]: '"' + ticket_data.Subject.replace(/"/g, '\\"') + '"',
[column_headings[13]]:
'"' +
get_severity_mapping_value(ticket_data.SLA.replace(/"/g, '\\"')) +
get_severity_mapping_value(
ticket_data.SLA ? ticket_data.SLA.replace(/"/g, '\\"') : ''
) +
'"',
[column_headings[14]]: get_ticket_custom_field_value(
ticket_data.CustomFields,
Expand Down Expand Up @@ -581,7 +583,7 @@ function get_severity_mapping_value(rt_sla) {
'Severe': 'P1. Critical',
};

return mapping[rt_sla];
return rt_sla ? mapping[rt_sla] : 'P3. Minor';
}

/**
Expand Down

0 comments on commit 158537c

Please sign in to comment.