How to upload files into Catalog item variables via ATF

tasankuluulu
Tera Contributor

Hello,

 

There is a Catalog Item which has few fields. Some of the fields are to upload attachments. How to upload files into these variables via ATF?

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi @tasankuluulu,

 

Yes. Follow the below steps.

Screenshot 2023-01-14 at 12.09.17 PM.png

 

1) Use the Record Query test steps. Table will be sys_attachment and add the attachment sys_id for query.

Screenshot 2023-01-14 at 12.07.30 PM.png

2) Open a catalog item

3) Set the variable values and for attachment type variable use the same sys_id.

Screenshot 2023-01-14 at 12.13.02 PM.png

 

4) Add your next steps or submit form.

 

 

Thanks,
Sagar Pagar

 

 

The world works with ServiceNow

View solution in original post

10 REPLIES 10

Hello ,did you able to add attachment sys_id?

Hi,

 

Thanks for sharing the solution. But if we don't have the attachment upload option as a variable, only a link is provided in the catalog item named "Add attachments" . In that case how to add attachment with the option mentioned above.

Thank you for sharing your solution. unfortunately it is not working for me. First, why is the record query step needed? just to be sure we are grabbing the correct id? and second, I am using this in a record producer but when I set the value the screen shows 'invalid value' even thought the record query step successfully found the attachment. Any ideas on why it is not working for me?

 

thanks,

Maria t.

We faced the same issue. For us it was a permission issue. The dummy attachment we uploaded to sys_attachment was against a particular table which the impersonated user in the ATF did not have access to. There's an OOTB ACL that grants read access to sys_attachment records if the table_name field is empty, so we decided to make this blank on the dummy sys_attachment record which allowed things to work. Just keep in mind that this will make the attachment available to all users (if you have explicit roles plugin turned on, it'd make it available to all snc_internal users). 

sivanarayan
Tera Contributor

@Nick Parsons If possible, can you please share the test steps here which you created to handle the Upload/Add attachments functionality.

Thanks in advance.