Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0125-preview· openaiHugging Face Suzhen/CodeChat

We have a Sop reminder that triggering every monday. I need that whenever the reminder…

  1. User

    We have a Sop reminder that triggering every monday. I need that whenever the reminder triggers that attachment will also go with it in servicenow

  2. Assistant

    To ensure an attachment goes out with a Standard Operating Procedure (SOP) reminder every Monday in ServiceNow, you'd typically need to customize or set up a workflow or a scheduled job that both sends the reminder and includes the attachment. While direct manipulation of ServiceNow to include attachments with reminders might require some specific steps or custom scripting depending on your ServiceNow version and how your instance is set up, I can guide you through a general approach.

    General Approach:

    1. Identify or Create the SOP Document as an Attachment

    Make sure the SOP document you want to send is already uploaded to ServiceNow as an attachment. This could be attached to a record in a table, for example, a knowledge base article.

    2. Create or Modify a Business Rule or Scheduled Job for the Reminder

    You will need a scheduled job or a business rule that triggers every Monday to send out your SOP reminder. If you already have a job or rule for the reminder, you will modify this to include sending the attachment.

    If Creating From Scratch:
    • Go to System Definition > Scheduled Jobs.
    • Click on New to create a new job or find your existing one.
    • Set it to run weekly, on Mondays, and add your script in the Script field.
    Scripting the Attachment Sending:

    You will need a script that not only sends the reminder but also fetches the attachment from ServiceNow and includes it in the reminder. Here's a very basic outline of what the script could look like:

    // Query for the SOP document/attachment
    var attachmentGR = new GlideRecord('sys_attachment');
    attachmentGR.addQuery('table_name', 'YOUR_TABLE_NAME_HERE'); // Specify the table name
    attachmentGR.addQuery('file_name', 'YOUR_FILE_NAME_HERE'); // Specify the file name
    attachmentGR.query();
    
    if (attachmentGR.next()) {
      // Code to send the reminder and include attachmentGR as an attachment
      var email = new GlideEmailOutbound();
      email.setSubject("Your Weekly SOP Reminder");
      email.setBody("Please find attached this week's SOP reminder.");
      email.addAddress("recipient@example.com"); // Specify recipient
      email.addAttachment(attachmentGR.sys_id); // Attach the SOP document
      email.send();
    }
    

    This is a very simplistic script and you would need to adjust it to match your specific requirements, such as filtering for the correct attachment or specifying recipients.

    Note:

    • The script assumes you're familiar with the basics of scripting in ServiceNow.
    • The names of tables and fields should be replaced with those in your ServiceNow instance.
    • For complex requirements, you might need to delve deeper into ServiceNow's documentation or consult with a ServiceNow developer.

    Testing:

    Always test your scheduled job or business rule in a non-production environment before rolling it out to ensure it behaves as expected.

    Final Steps:

    After setting up and testing your scheduled job or business rule, schedule it to run on Mondays. Ensure all parameters, such as the right email recipients and the correct attachment, are configured correctly.

    This approach provides a starting point. However, due to the myriad configurations and customizations possible in ServiceNow, you may need to adapt these instructions to fit your specific setup or consult the ServiceNow documentation for more detailed guidance.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.