<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hints on NXSL for acquiring list of ReponsibleUsers' email address]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">On yesterday Q&amp;A Webex session i've got a great idea on how to solve a challenge that i have for years - have generic EPP &amp; Email notification actions, while selecting email recipients based on user's email addresses and group membership.</p>
<p dir="auto">Apparently this can be implemented elegantly using the new feature Responsible Users.</p>
<p dir="auto">Users and group objects can be set as <strong>Responsible Users</strong> on nodes and containers.<br />
Then NXSL have the necessary functionality to write a script that finds the responsible users for a given node and return a list of their email addresses.<br />
Then this script can be run through a macro in email notification action recipient address field - hopefully with a $node parameter. So that this script always returns the full list of email recepients for this particular node.</p>
<p dir="auto">All above combined together will deliver exactly what i need - if i understand it correctly.</p>
<p dir="auto">I spent few hours trying to develop such a NXSL script, but failed miserably. Can someone help with some hints? I am sure this will be beneficial for the community, not just me.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.netxms.org/topic/6977/hints-on-nxsl-for-acquiring-list-of-reponsibleusers-email-address</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 16:07:01 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6977.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Mar 2021 08:57:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hints on NXSL for acquiring list of ReponsibleUsers' email address on Fri, 05 Mar 2021 23:30:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">Here's an example of such script:</p>
<pre><code>global emails = "";

sub parseGroupsOrUsers(arr)
{
  for (i : arr)
  {
    if (i-&gt;isGroup)
    {
      parseGroupsOrUsers(i-&gt;members);
    }
    else
    {
      if (i-&gt;email != "")
      {
        if (emails != "") emails = emails . "; ";
        emails = emails . i-&gt;email;
      }
    }
  }
}

parseGroupsOrUsers($node -&gt; responsibleUsers);
println(emails);
</code></pre>
<p dir="auto">In NetXMS users groups can contain not only users, but also user groups, hence the script is recursive.</p>
<p dir="auto">Here's a not-yet-documented way to print all attributes and values of responsible users/gropus:</p>
<pre><code>for (r : $node-&gt;responsibleUsers)
{
  for(a : r-&gt;__class-&gt;attributes)
     println(a . " = " . r-&gt;__get(a));
  println;
}
</code></pre>
]]></description><link>https://forum.netxms.org/post/29676</link><guid isPermaLink="true">https://forum.netxms.org/post/29676</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Fri, 05 Mar 2021 23:30:14 GMT</pubDate></item></channel></rss>