Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Copy attachments from Change Request to Change Task records

Naga Ravindra R
Kilo Sage

change management

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Naga Ravindra Reddy 

Instead of replicating the attachments in the different table you can use this feature

"Related Attachments" Related List

Regards
Ankur

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

View solution in original post

4 REPLIES 4

Kieran Anson
Kilo Patron

When posting questions on the community, be a descriptive as possible otherwise we won't be able to help you. These past 6 questions look to be very much like stories that you've been assigned and have put no thought in. 

We are here to help / assist / guide. We are not here to do your job.

10+ Tips for writing a quality community question

Community Alums
Not applicable

Hi Naga Ravindra,

 

The above requirement can be achieved through the Business Rule.

 

i have attached screenshot of it

 

//Inside Script in Business Rule

(function executeRule(current, previous /*null when async*/) {

	var attachment = new GlideSysAttachment();
	var changeRequestSysId=current.getValue('change_request');
	


	var copiedAttachments = attachment.copy('change_request', changeRequestSysId, 'change_task',current.sys_id);
	//gs.addInfoMessage('Copied attachments: ' + copiedAttachments);



})(current, previous);

 

GlideSysAttachment doc for more Information : GlideSysAttachment

Mark ✅ Correct if this solves your issue and also mark ???? Helpful if you find my response worthy based on the impact.

Regards,

Akshay

Community Alums
Not applicable

@Naga Ravindra Reddy 

Hope you are doing good.

Did you get a chance to check on the solution provided to resolve your query?

If your query is resolved please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Akshay

Ankur Bawiskar
Tera Patron
Tera Patron

@Naga Ravindra Reddy 

Instead of replicating the attachments in the different table you can use this feature

"Related Attachments" Related List

Regards
Ankur

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