<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>post Service Exchange for Consumers – Conditional Attachment Sync in Technology articles</title>
    <link>https://www.servicenow.com/community/technology-articles/service-exchange-for-consumers-conditional-attachment-sync/ta-p/3561555</link>
    <description>&lt;P&gt;Out of the box, a Service Exchange Remote Task Definition with &lt;STRONG&gt;Send Attachments = true&lt;/STRONG&gt; will sync all attachments to the partner instance, and with &lt;STRONG&gt;Send Attachments = false&lt;/STRONG&gt; will not sync any attachments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This solution adds a middle ground:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;when Send Attachments = false, only the attachments that match a customer-defined condition are synced.&lt;/LI&gt;
&lt;LI&gt;when Send Attachments = true, out-of-box behavior is unchanged and all attachments are synced.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;An asynchronous business rule, &lt;STRONG&gt;SE Con Cond Sync Att from Parent Task&lt;/STRONG&gt;, is created on &lt;STRONG&gt;sys_attachment&lt;/STRONG&gt; table. No edits are made to any out-of-box business rules. On attachment insert the business rule resolves the parent record to its matching Service Exchange remote task(s), reads the definition's &lt;STRONG&gt;send_attachments&lt;/STRONG&gt; flag, and if &lt;STRONG&gt;send_attachments&lt;/STRONG&gt; flag is false AND the attachment matches the configured condition, syncs the attachment to the provider instance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Business Rule Condition&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The business rule condition uses the same guards as the out-of-box sync attachments business rule but works inside the Global scope.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Condition&lt;/P&gt;
&lt;P&gt;!new sn_sb.SBTransportUtilBase().isTransporterUser(gs.getUserName()) &amp;amp;&amp;amp;&lt;/P&gt;
&lt;P&gt;current.getValue("table_name").slice(0,6) != "sn_sb_" &amp;amp;&amp;amp;&lt;/P&gt;
&lt;P&gt;new GlideRecord(current.getValue("table_name")).instanceOf("task")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why each part of the condition?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;isTransporterUser(...) - skip attachments created by the transporter service account (prevents re-processing replicated copies).&lt;/LI&gt;
&lt;LI&gt;table_name.slice(0,6) != "sn_sb_" - skip the attachment copies that land on remote task records.&lt;/LI&gt;
&lt;LI&gt;GlideRecord(...).instanceOf("task") replaces GlideTableHierarchy because GlideTableHierarchy is not defined in a Global business rule. – only sync for extension of task table.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Included in Update Set&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Global async business rule: SE Con Cond Sync Att from Parent Task&lt;/LI&gt;
&lt;LI&gt;System property: sn_sb_attach_filter.consumer.query&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code is &lt;STRONG&gt;not an official ServiceNow product&lt;/STRONG&gt; and is provided as-is without warranty or support. Test thoroughly in a non-production environment before use on any production instance.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jun 2026 20:16:57 GMT</pubDate>
    <dc:creator>Kenny Caldwell</dc:creator>
    <dc:date>2026-06-18T20:16:57Z</dc:date>
    <item>
      <title>Service Exchange for Consumers – Conditional Attachment Sync</title>
      <link>https://www.servicenow.com/community/technology-articles/service-exchange-for-consumers-conditional-attachment-sync/ta-p/3561555</link>
      <description>&lt;P&gt;Out of the box, a Service Exchange Remote Task Definition with &lt;STRONG&gt;Send Attachments = true&lt;/STRONG&gt; will sync all attachments to the partner instance, and with &lt;STRONG&gt;Send Attachments = false&lt;/STRONG&gt; will not sync any attachments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This solution adds a middle ground:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;when Send Attachments = false, only the attachments that match a customer-defined condition are synced.&lt;/LI&gt;
&lt;LI&gt;when Send Attachments = true, out-of-box behavior is unchanged and all attachments are synced.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;An asynchronous business rule, &lt;STRONG&gt;SE Con Cond Sync Att from Parent Task&lt;/STRONG&gt;, is created on &lt;STRONG&gt;sys_attachment&lt;/STRONG&gt; table. No edits are made to any out-of-box business rules. On attachment insert the business rule resolves the parent record to its matching Service Exchange remote task(s), reads the definition's &lt;STRONG&gt;send_attachments&lt;/STRONG&gt; flag, and if &lt;STRONG&gt;send_attachments&lt;/STRONG&gt; flag is false AND the attachment matches the configured condition, syncs the attachment to the provider instance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Business Rule Condition&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The business rule condition uses the same guards as the out-of-box sync attachments business rule but works inside the Global scope.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Condition&lt;/P&gt;
&lt;P&gt;!new sn_sb.SBTransportUtilBase().isTransporterUser(gs.getUserName()) &amp;amp;&amp;amp;&lt;/P&gt;
&lt;P&gt;current.getValue("table_name").slice(0,6) != "sn_sb_" &amp;amp;&amp;amp;&lt;/P&gt;
&lt;P&gt;new GlideRecord(current.getValue("table_name")).instanceOf("task")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why each part of the condition?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;isTransporterUser(...) - skip attachments created by the transporter service account (prevents re-processing replicated copies).&lt;/LI&gt;
&lt;LI&gt;table_name.slice(0,6) != "sn_sb_" - skip the attachment copies that land on remote task records.&lt;/LI&gt;
&lt;LI&gt;GlideRecord(...).instanceOf("task") replaces GlideTableHierarchy because GlideTableHierarchy is not defined in a Global business rule. – only sync for extension of task table.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Included in Update Set&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Global async business rule: SE Con Cond Sync Att from Parent Task&lt;/LI&gt;
&lt;LI&gt;System property: sn_sb_attach_filter.consumer.query&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code is &lt;STRONG&gt;not an official ServiceNow product&lt;/STRONG&gt; and is provided as-is without warranty or support. Test thoroughly in a non-production environment before use on any production instance.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2026 20:16:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/technology-articles/service-exchange-for-consumers-conditional-attachment-sync/ta-p/3561555</guid>
      <dc:creator>Kenny Caldwell</dc:creator>
      <dc:date>2026-06-18T20:16:57Z</dc:date>
    </item>
  </channel>
</rss>

