- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I need to submit a Catalog Item during a test, but there is a mandatory attachment field.
The issue is that when using "Set Variable Values" the input appears as a String/Single Line Text field, so I can't mock a generic image (for example) which would be sufficient, since the field itself isn't the focus of the test, just a requirement for submission.
Even using a "File Attachment" parameter doesn't seem to work. Does anyone know a workaround for this to submit the form via ATF?
It is worth mentioning that I have already tried using a sys_attachment sys_id in this input. I also tried using a different "Add Attachments" test step, but it only works for that OOB field at the bottom of the form, not for custom variables.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The solution that worked for me was using the sys_id of a sys_attachment record directly in the string input generated by the attachment field, as suggested.
However, the important detail is that the "Table name" column is empty; presumably, if the test were performed by a user with access to that specific table or an admin role, this wouldn't be an issue.
Thank you all for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Just following up to see whether my suggested solution worked for you.
If you're still facing any issues, I'd be happy to help further.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Unfortunately, it still hasn't solved my problem. For some reason the variable does not accept even an valid attachment sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
For custom attachment variables, ATF’s standard Add Attachments step doesn’t handle them well. A common workaround is to create a dummy attachment via a server-side script and associate it with the relevant record before submitting the Catalog Item. Passing the sys_attachment sys_id directly usually won’t work because the variable expects a different value format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I managed to get it working by using a sys_id of sys_attachment record directly in the string input, but the catch is: the Table name collumn is empty.
The impersonated user's lack of access likely affects the reference used in the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The solution that worked for me was using the sys_id of a sys_attachment record directly in the string input generated by the attachment field, as suggested.
However, the important detail is that the "Table name" column is empty; presumably, if the test were performed by a user with access to that specific table or an admin role, this wouldn't be an issue.
Thank you all for the help!
