How to handle mandatory attachment field on a form in ATF?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2025 11:53 PM
Hello all
I have a custom attachment field on the change request form which I need to automate using ATF. How do I handle the mandatory attachment field using 'Set Field Values' step?
I have already tried to use 'Record Query' to query a random attachment on the 'sys_attachment' table but it does not allow me to refer on the 'Set Field Values' step.
Hard coding the sys_id of a random attachment on the field also did not work.
Please help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2025 12:36 AM
Hi @Mayank Das3
To add a mandatory attachment in Automated Test Framework (ATF) for a form, you need to use a workaround since standard "mandatory" fields are not supported for attachments. A common approach is to use the "Add Attachment" step in the ATF, and on the form, use a client-side script or a business rule to enforce the attachment requirement before submission.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2025 12:37 AM
and follow the below thread
https://www.servicenow.com/community/developer-forum/how-to-add-attachment-to-a-mandatory-attachment...