- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2023 06:41 AM
I'm doing some work with notifications that get sent to users from the time they create an incident, to the incidents resolution. My notification fires whenever the incident state changes to "In Progress" or when "Assigned To" changes, and has a table populated with information from the incident. I want one of the rows to change depending on whether the incident's state is changed to in progress without the assigned to field being populated, or if the assigned to field is changed after the state is changed.
Here's a snippet of the code I'm using:
template.print('<tr>');
if (current.variables.assigned_to == null) {
template.print('<td style="border:1px solid black; border-right-color: gray; border-bottom-color: gray">Assignment Group</td>');
template.print('<td style="border:1px solid black; border-right-color: gray; border-bottom-color: gray">${assignment_group}</td>');
}
else {
template.print('<td style="border:1px solid black; border-right-color: gray; border-bottom-color: gray">Assigned To</td>');
template.print('<td style="border:1px solid black; border-right-color: gray; border-bottom-color: gray">${assigned_to}</td>');
}
// template.print('<td style="border:1px solid black; border-right-color: gray; border-bottom-color: gray">Assigned To</td>');
// template.print('<td style="border:1px solid black; border-right-color: gray; border-bottom-color: gray">${assigned_to}</td>');
template.print('</tr>');As it stands, the table is only being populated with the Assignment Group, even if the Assigned To field is populated at the same time the state is changed to "In Progress". Can someone point me in the right direction?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2023 07:20 AM - edited ‎08-29-2023 07:21 AM
You probably don't need the "variables" part of "current.variables.assigned_to == null". So, that line would just be...
if (current.assigned_to == null) {
You might want to also change it to...
if (gs.nil(current.assigned_to) || current.assigned_to == '') {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2023 07:20 AM - edited ‎08-29-2023 07:21 AM
You probably don't need the "variables" part of "current.variables.assigned_to == null". So, that line would just be...
if (current.assigned_to == null) {
You might want to also change it to...
if (gs.nil(current.assigned_to) || current.assigned_to == '') {
