How to add attachment to the catalog item variables using the ATF

snow57
Tera Contributor

Hi,

 

How to add a attachment to the Catalog item (to a variable) using the ATF. And i don't want to add it using the existing attachment in the sys_attachment table. Is there any way to do this ?

 

Thanks,

 

5 REPLIES 5

Abbas_5
Tera Sage
Tera Sage

Hello @snow57,
Please refer to the below link:
https://www.servicenow.com/community/developer-forum/how-to-upload-files-into-catalog-item-variables...

 

If it is helpful, mark it as a thumbs-up!
Thanks & Regards,
Abbas

 

Shaqeel
Mega Sage

Hi @snow57 

 

It can only be done by following ways:

 

Shaqeel_0-1696926237969.png

 

 

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

Shaqeel_1-1696926237972.png

FYI: You have to take a sys_id from Attachment [sys_attachment] table. It cab be sample file's sys_id.

 

2) Open a catalog item.

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

Shaqeel_2-1696926237974.png

 

 

4) Add your next steps or submit form.

 

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

will try this way and i hope it should work

 

Ravi Sharma
Tera Contributor

 

Hi Shaqeel & Abbas_5

 

Do this step would be applicable for server end ATF. Currently I have created atf for which run on server side and it was working but as soon as upgradation took place the attachment got erased from the atf due to which its failing. Currently I have only option is that to upload attachment in atf . But looking for permanent solution where after upgrade attachment should be at his place.