How to transform attachments from variable section to top of the RITM?

Sanjay33
Tera Contributor

Dear Team,

 

We have two variables(type is attachment) in one of the catalog item, whatever the attachments was attached here,

Same attachments should also get attached at the top of the RITM(refer the attachment). This will only applicable to the same catalog item only. Kindly let me know.

 

Note: Should only use workflow and will applicable to same catalog item only.

 

Thank you.

Sanjay33_0-1741966596756.png

 

1 REPLY 1

Chaitanya ILCR
Kilo Patron

Hi @Sanjay33 ,

Create a run script activity in the workflow with following script.

 

or use this script in a BR on sc_req_item with conditions added

 

var saGr = new GlideRecord('sys_attachment');
saGr.addEncodedQuery('table_name=ZZ_YYsc_req_item^table_sys_id='+current.getValue('sys_id'))
saGr.query();
while(saGr.next()){
	saGr.table_name = 'sc_req_item';
	saGr.update();
}

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya