Skip to main content
All CollectionsBuild AutomationsCases
Automating Attachments in Torq Cases: Add Context and Information
Automating Attachments in Torq Cases: Add Context and Information

Learn how to automatically manage attachments in Torq cases.

Updated this week

Automatically add attachments like screenshots, source code, and other relevant documents to cases. This ensures that all essential information and context are included, boosting the accuracy of investigations.

Learn how to use attachments during a case investigation.

At this stage, we recommend avoiding potentially malicious files as attachments, as other users may accidentally download and open them.

Automatically Managing Attachments: Essential Steps

Efficiently manage case attachments using steps provided by Torq:

  • Add attachment to case

  • Get attachment download link

  • List case attachments

  • Remove attachment from case

Adding an Attachment

To add an attachment to a case, use the Add attachment to case step. You will need to:

  1. Name the Attachment: Give the attachment a descriptive name.

  2. Select the Input Type:

    • Raw Data: Input raw data directly from the workflow context to save as a file attachment.

    • File: Provide file content either in base64 format or via a file URL to attach it to the specified case.

File links can be available through trigger events or steps configured to return the output as a file. By default, file links are non-shareable and have the format: tqfile://steps/XXXXXXX. These links require the file function to access the file content and add it as an attachment to a case:
{{ file $.<path_to_non_shareable_file_url> }}. Read more about working with files.

Accessing an Attachment

To access an attachment, utilize the Get attachment download link step to generate a downloadable link, providing straightforward access to the attachment when needed.

Use the Get attachment download link step

Including Images in Case Descriptions or Notes

To add images:

  1. Attach the Image: Use the Add Attachment to Case step to upload the image.

  2. Embed the Image: Use the static_link output field from the Add Attachment to Case step to insert the image into the case description or notes. In the Change Case Description or Add a New Note to Case steps, apply the following HTML tag (adjusting the path based on the step name):

    <img src="{{ $.add_attachment_to_case.attachment.static_link }}">

Example: Adding a Screenshot to a Case

  1. The output from the Screenshot HTML step is saved as a file and attached to the case.

  2. The static_link is then used to display the screenshot directly in a note.

Saving the screenshot as a file is optional. This process will also work if the screenshot is passed as a Base64 string directly to the Add Attachment to Case step.

Did this answer your question?