Attach file isn't exist in ticket

tuitendung
Tera Contributor

In PDI, I created a new scope app and a table within this scope app. Additionally, I also created a record producer to create tickets belonging to the newly created table. However, I encountered an issue where when I submit a ticket with an attached file, the ticket in the ITIL view does not display the attached file. Upon checking the "sys_attachment" table, I found that the file exists but is stored in two tables: one in the table I created and another in a table named "ZZ_YYsc_cart_item." How can I resolve this? Please advise.

tuitendung_0-1709735094138.png

 

5 REPLIES 5

Sumanth16
Kilo Patron

Hi @tuitendung ,

 

Please verify Read ACL on the sys_attachment table for that user.

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

 

 

 

shyamkumar VK
Kilo Patron

@tuitendung , That's because you might have been using "file attachment" Variable to Attach your Attachments 

 

ZZ_YY is appended at the start of the table name this tells the system not to show the file as an attachment on the top of the form.

 

if you want to display at the top  and if you want to remove ZZ_YY we need to design BR for this 

 

1. Create an Asynch BR on Insert 

2. Table should be your Target table where your want to Display the Attachment (ex incident , change)

3. In advance write the Below Logic 

 

	// Add your code here
	var gr = new GlideRecord("sys_attachment");
	gr.addQuery("table_name", "ZZ_YY" + current.getTableName());
	gr.addQuery("table_sys_id", current.sys_id);
	gr.query();
	if (gr.next()) {
		gr.table_name = current.getTableName();
		gr.update();
		new global.VariableUtil().copy(gr.sys_id, current.getTableName(), current.sys_id); 
	}

 

this will now shows the Attachment on the Top of the Records as the other does 

 

Regards,

Shyamkumar 

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Hi @shyamkumar VK ,
It didn't work. I created BR with these configurations:

tuitendung_0-1709818184399.png

tuitendung_1-1709818209382.png

 

@tuitendung , Still Attachment are not showing on the Top?

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar