Show if a ticket has an attachment in the list view

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2020 02:07 PM
Hello all,
i am new to scripting and am learning as I go. Can someone tell me how to set up the task table to show all tasks that have attachments in the list view? Not sure what all i have to do to make this happen.
Thanks in advance for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2020 02:10 PM
You will need to create a field HasAttachment and set it to true or false accordingly.
You may find some useful information here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2020 02:56 PM
Hi,
I think you'll have to create a dynamic filter for this, and call it inside an application menu if you want to create a direct link from left menu to apply over that table with that condition.
Your code inside script include for recovering sys_ids of task with attachment, should look as follows:
var array = [];
var gr= new GlideRecord('task');
gr.query();
while(gr.next()){
if(gr.hasAttachments()){
array.push(gr.sys_id);
}
}
return 'sys_idIN' + array.join();
and also for calling you dynamic filter use: javascript: newScriptIncludeName().function();
If it was helpful, please give positive feedback.
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆