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.

Passing an attachment form service portal to the targeted record in Record Producer i.e. "Incident".

Chinmay_Batra
Tera Contributor

Usecase: We want to pass an attachment from the service portal to the targeted record in Record Producer i.e. "Incident" (refer below image).

Chinmay_Batra_3-1701625755985.png

 



1. For this we need to write one script in the "Record Producer" script section (refer below image).

Chinmay_Batra_0-1701625091109.png


2. Script: //for Attachment
GlideSysAttachment.copy("sc_cat_item_producer", current.parent, "incident", current.sys_id);

 

Chinmay_Batra_1-1701625159901.png

3. I have attached a screenshot in the OOTB Attachment Variable in the service portal (refer below image).

Chinmay_Batra_2-1701625324499.png

 

Chinmay_Batra_4-1701625943794.png

 

4. After submitting this above form the script will run and it'll pass the screenshot directly to the "Incident Work Notes" (refer below image).

Chinmay_Batra_7-1701626338868.png

 

If you found this article valuable please mark it as 👍Helpful.

Thank you,
Chinmay Batra

0 REPLIES 0