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.

Variables not writing to Task from Catalog Item

aguanci
Tera Expert

Hi All,

 

For our Lifecycle Event Case we are assigning out a Task with Acknowledgement Type of Submit a Catalog item. I have configured the catalog item but when testing, I find that nothing submitted in the Catalog Item is written to the form. 

 

I have the following code in the Record Producer to map the attachment to a custom field on the Task table but it will not write: 

 

var gr = new GlideRecord('sys_attachment');
if(gr.get(producer.u_attachment)){ //attachment field name
    gr.table_name='sn_hr_core_task';     //copy to table name
    gr.table_sys_id=current.sys_id;//copy to record sys_id
    gr.update();
}
 
Variable and Field name = u_attachment

 

Having a similar issue to this community post but could not get a clear answer out of it:  https://www.servicenow.com/community/hrsd-forum/attachment-variable-is-not-attaching-the-attachment-... 

 

What am I missing? 

 

Thanks!

1 REPLY 1

Gangadhar Ravi
Giga Sage

Hi @aguanci 

 

Please check this post and see if helpful https://www.servicenow.com/community/hrsd-forum/make-the-attachment-variable-used-in-the-catalog-ite...

 

Please mark my answer correct and helpful if this works for you.