05-16-2022 01:55 PM
Greetings,
So I have been pulling rasterized images with the names of the URLs attached into XSOAR and attempting to pipe them into some ServiceNow tickets, but character restrictions are giving the system issues on what files to call during the upload process.
The files are stored as the proper URL context, but filenames cannot have slashes in them, so the file names are being edited with underscores in place of the slashes when the files are generated or when you attempt to download said file, but in XSOAR it still thinks of the file as being named with proper URL context including the slashes, so when I go to upload them in other tasks the files are not found.
I have attempted to replace characters via conditional tasks after the images are generated but the system is limiting me on what contexts I can use to identify them, and I can't seem to pull anything in to transform.
Any ideas?
06-17-2022 11:04 AM
Hey @asawyer,
So I finally got it to work. By moving the re-naming steps into the rasterize process instead of the SN upload process they are finally posing into the ticket with the the full names.
Thanks for all of your help!
05-24-2022 05:41 PM
It looks like you are passing in the URL to the `file_name` input to `rasterize`. The default filename for the `rasterize` result is simply "url.png". Could you try leaving the `file_name` input blank or passing in a different value instead of the URL?
05-26-2022 07:18 AM
Hey @asawyer
The plan is to get the url address in the filename so that when It gets move around or exported to tickets you can tell where the image was from.
Rasterize is working fine with default naming.
05-26-2022 02:38 PM
Hey @Jersey_Mankowski – Ah, I'm tracking now. There are a couple of complications here. The first is the replacement of certain characters, as you mentioned in your original post, and the other is a restriction on filename length (on both the XSOAR and ServiceNow side).
The see what XSOAR changed the filename to, download the result of rasterize and view the filename.
From my testing, the maximum filename length for ServiceNow is 255 characters. So to pass in a valid file_name arg value to servicenow-upload-file:
1. Replace at least the slashes with underscores, so the value is not misinterpreted as a URL (Replace transformer)
2. Truncate the value to 251 characters max to leave room for the file extension – You can do this using the RegexGroups transformer with regex: ^(.{,251})
3. Concat the ".png" file extension
Please give that a try and let us know if it works!
05-27-2022 09:32 AM
Hey @asawyer
I like what you are thinking, and that could be half of it, but with the new transforms I have been seeing an error in the RE.py lib, and some other errors with the replace, I did get it to go through as expected but it's still failing to upload the file and says it does not exist, even when looking up by artifact.
For reference I am doing the file_name transformations in the !servicenow-upload-file task. I have also tried a replace on the slashes to underscore directly after the rasterize, but it would never find anything. I feel like the automatic file renaming by the system is getting these images corrupted or lost somehow, but it's hard to confirm that when I can go download the artifacts.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!