Use the Scratchpad to complete your request fulfillment tasks

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Use the Scratchpad to complete your request fulfillment tasks

    The Scratchpad feature in the Service Exchange application enables providers to send real-time updates to their consumer's ServiceNow instance during request fulfillment tasks. This is essential for progressing the Zero Touch request flow, particularly after completing confirmation and shipment tasks. Providers must use the PSBScratchpadUtil API to send task-specific Scratchpad updates in a predefined JSON format.

    Show full answer Show less

    Key Features

    • Task Confirmation Updates: Providers send a Scratchpad update indicating the order status as "confirmed" to notify consumers that the request confirmation task is complete.
    • Shipment Updates: Providers send detailed shipment information including order status, tracking number, carrier, and asset details such as model number, asset tag, and serial number.
    • Order Status Values:
      • partiallyshipped: When assets in a request are shipped in multiple shipments.
      • fullyshipped: When all assets in the request have been shipped.
    • Asset Information: For each shipped asset, include status, tracking number, carrier, model number, asset tag, and serial number. Consumable assets exclude asset tag and serial number.
    • Single Shipment Updates: Each asset’s shipment information should be sent only once, even if there are multiple shipments.

    Practical Implementation

    Providers must implement code using the PSBScratchpadUtil API to send JSON-formatted Scratchpad updates for each relevant task. Sample code snippets illustrate how to send confirmation and shipment updates by querying the provider task record and updating it with the respective Scratchpad JSON.

    Why This Matters

    Sending accurate Scratchpad updates ensures the consumer's ServiceNow instance correctly tracks the progress of request fulfillment and shipment status. This synchronization supports automated Zero Touch workflows, reducing manual intervention and improving service delivery transparency between providers and consumers.

    As a provider, use the Scratchpad feature of the Service Exchange application to send updates to the ServiceNow instance of your consumer while performing the request fulfillment tasks.

    The Zero Touch request flow requires you to send Scratchpad updates to your consumer's ServiceNow instance when you complete the confirmation and shipment tasks successfully. Based on the updates that you send, the Zero Touch flow progresses on your consumer's ServiceNow instance.

    You must include the code specific to your tasks in the PSBScratchpadUtil API. For more information, see Using the Scratchpad for Service Exchange tasks. Confirm that the Scratchpad codes associated with the tasks of your request fulfillment flow are in the following format.

    Sample code for request confirmation

    var scratchPadJSON = {
      "orderStatus": "confirmed"
    };
    var value = JSON.stringify(scratchPadJSON); 
    var rtGR = new GlideRecord("sn_sb_pro_provider_task"); 
    rtGR.get(<ProviderTaskID>); 
    if (rtGR.isValidRecord()) { 
      var util = new sn_sb_pro.PSBScratchpadUtil(); 
      util.update(rtGR, "confirmation", value); 
    }
    

    When you confirm a provider task, a Scratchpad update with the order status as Confirmed is sent to your consumer's ServiceNow instance.

    Sample code for shipment

    var scratchPadJSON = {
    "orderStatus": "partially_shipped / fully_shipped"
    "orderLineItems" : 
      [{ 
        "status": "shipped",
        "trackingNumber": "123",
        "carrier": "C1",
        "modelNumber": 'MD322LL/A',
        "assetTag": 'P1000177',
        "serialNumber": 'P1000177'
      },{ 
        "status": "shipped",
        "trackingNumber": "123",
        "carrier": "C1",
        "modelNumber": 'MD322LL/A',
        "assetTag": 'P1000178',
        "serialNumber": 'P1000178'
      }
    ]
    };
    
    When you ship the requested items and confirm the shipment, a Scratchpad update with the following details are sent to your consumer's ServiceNow instance:
    • Order status: Depending on how the provider has shipped the assets in a request, the Order status can have the following values:
      • partially_shipped: Assets in the request are shipped through multiple shipments.
      • fully_shipped: All the assets in the request are shipped.
      For example, consider that a requester has requested for five assets. If you ship only three assets though a shipment, you should pass the Order status as partially_shipped. When you ship the remaining two assets, you should pass the Order status as fully_shipped.
    • Tracking number: Every shipment has a unique tracking number.
    • Carrier: The name of the carrier through which the provider shipped the assets.
    • Model number: Unique model number of the asset that is shipped.
    • Asset tag: Unique asset tag of the asset that is shipped.
    • Serial number: Serial number of the asset.
    Note:
    The shipment update for consumable assets doesn't include Asset tag and Serial number details. If there are multiple shipments, the information of the asset in a shipment must be sent to your consumer's ServiceNow instance only once.