Change the "deleted attachment" message in "Ticket Attachments"

F_bio Santos
Kilo Sage

Hi everyone Im trying to change the "deleted attachment" message in "Ticket Attachments", to show which attachment got deleted, but I dont know how to get the attachment, can anyone help with this ?

F_bioSantos_0-1698052184003.png


Code:

    if (input && input.action == "deleted") {
        gr.comments = input.action + " attachment";
        gr.update();
    }

 

13 REPLIES 13

What it does now is, it only runs when there is more than 1 attachment and it always get's the first one.

For example:

If I have:

test2.txt
test.txt

And delete the "test2.txt" it returns: "Deleted attachment: test.txt"

if I delete the "test1.txt" it return: "Deleted attachment: test2.txt"

@F_bio Santos 

then probably it's wrong table name

what came in data.table?

what came in data.sys_id? Is that a sysId of the record on which file is present or sysId of sys_attachment?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

What it does now is, it only runs when there is more than 1 attachment and it always get's the first one.

For example:

If I have:

test2.txt
test.txt

And delete the "test2.txt" it returns: "Deleted attachment: test.txt"

if I delete the "test1.txt" it return: "Deleted attachment: test2.txt"

@F_bio Santos 

just use while loop to show all the messages

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader