<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=OnCreateSetDeptHeadCc</id>
	<title>OnCreateSetDeptHeadCc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=OnCreateSetDeptHeadCc"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;action=history"/>
	<updated>2026-08-21T23:30:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;diff=26357&amp;oldid=prev</id>
		<title>Tharn at 01:17, 14 August 2016</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;diff=26357&amp;oldid=prev"/>
		<updated>2016-08-14T01:17:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:17, 13 August 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Custom Condition:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Custom Condition:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nowiki&lt;/del&gt;&amp;gt;# make sure we are called from a on create condition and&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;# make sure we are called from a on create condition and&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # make sure department is filled out&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # make sure department is filled out&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  if (&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  if (&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l38&quot;&gt;Line 38:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nowiki&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Custom action preparation code:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Custom action preparation code:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nowiki&lt;/del&gt;&amp;gt;# example: for &#039;Systems&#039; the group is &#039;Head Systems&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;# example: for &#039;Systems&#039; the group is &#039;Head Systems&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  my $derivedGroupName = &amp;#039;Head &amp;#039; . $self-&amp;amp;gt;TicketObj-&amp;amp;gt;FirstCustomFieldValue(&amp;#039;Department&amp;#039;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  my $derivedGroupName = &amp;#039;Head &amp;#039; . $self-&amp;amp;gt;TicketObj-&amp;amp;gt;FirstCustomFieldValue(&amp;#039;Department&amp;#039;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l81&quot;&gt;Line 81:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 83:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   return 1;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   return 1;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nowiki&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Custom action cleanup code:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Custom action cleanup code:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key bestpractical_mediawiki1459887241:diff:1.41:old-2396:rev-26357:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Tharn</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;diff=2396&amp;oldid=prev</id>
		<title>Admin: 4 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;diff=2396&amp;oldid=prev"/>
		<updated>2016-04-06T20:15:49Z</updated>

		<summary type="html">&lt;p&gt;4 revisions imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:15, 6 April 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key bestpractical_mediawiki1459887241:diff:1.41:old-2395:rev-2396 --&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;diff=2395&amp;oldid=prev</id>
		<title>BillCole: Reverted edits by 208.70.50.7 (talk | block) to last version by Best Practical</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;diff=2395&amp;oldid=prev"/>
		<updated>2012-08-21T03:44:38Z</updated>

		<summary type="html">&lt;p&gt;Reverted edits by &lt;a href=&quot;/wiki/Special:Contributions/208.70.50.7&quot; title=&quot;Special:Contributions/208.70.50.7&quot;&gt;208.70.50.7&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:208.70.50.7&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:208.70.50.7 (page does not exist)&quot;&gt;talk&lt;/a&gt; | &lt;a href=&quot;/wiki/Special:Block/208.70.50.7&quot; title=&quot;Special:Block/208.70.50.7&quot;&gt;block&lt;/a&gt;) to last version by &lt;a href=&quot;/wiki/User:Best_Practical&quot; title=&quot;User:Best Practical&quot;&gt;Best Practical&lt;/a&gt;&lt;/p&gt;
&lt;a href=&quot;https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;amp;diff=2395&amp;amp;oldid=2394&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>BillCole</name></author>
	</entry>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;diff=2394&amp;oldid=prev</id>
		<title>208.70.50.7: Missing a &#039;t&#039; in &#039;Script&#039;</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=OnCreateSetDeptHeadCc&amp;diff=2394&amp;oldid=prev"/>
		<updated>2012-07-30T01:23:23Z</updated>

		<summary type="html">&lt;p&gt;Missing a &amp;#039;t&amp;#039; in &amp;#039;Script&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Dept heads need to see and reply to tickets opened by their staff. This is accomplished by giving the global &amp;#039;Cc&amp;#039; group [[ShowTicket]] perms and automatically making the dept head a Cc on the ticket.&lt;br /&gt;
&lt;br /&gt;
On create in the case that [[CustomField]].Department = &amp;#039;Foo&amp;#039; then add group &amp;#039;Head Foo&amp;#039; as a Cc. Be sure to first check that the Requestor is not in the &amp;#039;Head Foo&amp;#039; group. That may be problematic for odd departments or units with more than one member in a &amp;#039;Head x&amp;#039; group. (See also [[OnCreateAddGroupCc]].)&lt;br /&gt;
&lt;br /&gt;
= Script =&lt;br /&gt;
&lt;br /&gt;
All tickets have a Department custom field mapping the ticket to a dept. I globally grant the Cc role [[ShowTicket]] and [[ReplyToTicket]] permission and then add the department head as Cc on their staff&amp;#039;s tickets. This way they can add comments and be aware of issues in their department. I do not yet wish to give them powers such as [[ModifyTicket]], so they can&amp;#039;t monkey with priorities etc. Therefore, I felt Cc more appropriate than [[AdminCc]] even after granting extra rights to Cc.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;Description: &amp;#039;&amp;#039;&amp;lt;/nowiki&amp;gt;[[OnCreateSetDeptHeadCc]]&amp;lt;nowiki&amp;gt;&amp;#039;&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;Condition: &amp;#039;&amp;#039;User Defined&amp;#039;&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;Action: &amp;#039;&amp;#039;User Defined&amp;#039;&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;Template: &amp;#039;&amp;#039;Global template: Blank&amp;#039;&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;Stage: &amp;#039;&amp;#039;&amp;lt;/nowiki&amp;gt;[[TransactionCreate]]&amp;lt;nowiki&amp;gt;&amp;#039;&amp;#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Custom Condition:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# make sure we are called from a on create condition and&lt;br /&gt;
  # make sure department is filled out&lt;br /&gt;
  if (&lt;br /&gt;
         (&lt;br /&gt;
           ($self-&amp;amp;gt;TransactionObj-&amp;amp;gt;Type eq &amp;quot;Create&amp;quot;)&lt;br /&gt;
           || ($self-&amp;amp;gt;TransactionObj-&amp;amp;gt;Type eq &amp;quot;CustomField&amp;quot;)&lt;br /&gt;
         ) &amp;amp;amp;&amp;amp;amp; (&lt;br /&gt;
           $self-&amp;amp;gt;TicketObj-&amp;amp;gt;FirstCustomFieldValue(&amp;#039;Department&amp;#039;)&lt;br /&gt;
           &amp;amp;amp;&amp;amp;amp; ($self-&amp;amp;gt;TicketObj-&amp;amp;gt;FirstCustomFieldValue(&amp;#039;Department&amp;#039;) ne &amp;#039;None&amp;#039;)&lt;br /&gt;
         )&lt;br /&gt;
      ) {&lt;br /&gt;
      #$RT::Logger-&amp;amp;gt;info(&amp;quot;Met User Defined OnCreateSetDeptHeadCc Condition #&amp;quot;.&lt;br /&gt;
      #    $self-&amp;amp;gt;TicketObj-&amp;amp;gt;id .&amp;quot; &amp;quot;.&lt;br /&gt;
      #    $self-&amp;amp;gt;TicketObj-&amp;amp;gt;FirstCustomFieldValue(&amp;#039;Department&amp;#039;) );&lt;br /&gt;
      return 1;&lt;br /&gt;
  } else {&lt;br /&gt;
      #$RT::Logger-&amp;amp;gt;info(&amp;quot;Did Not Meet User Defined OnCreateSetDeptHeadCc Condition #&amp;quot;.&lt;br /&gt;
      #   $self-&amp;amp;gt;TicketObj-&amp;amp;gt;id .&amp;quot; &amp;quot;. $self-&amp;amp;gt;TicketObj-&amp;amp;gt;FirstCustomFieldValue(&amp;#039;Department&amp;#039;) );&lt;br /&gt;
      return undef;&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Custom action preparation code:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# example: for &amp;#039;Systems&amp;#039; the group is &amp;#039;Head Systems&amp;#039;&lt;br /&gt;
  my $derivedGroupName = &amp;#039;Head &amp;#039; . $self-&amp;amp;gt;TicketObj-&amp;amp;gt;FirstCustomFieldValue(&amp;#039;Department&amp;#039;);&lt;br /&gt;
  &lt;br /&gt;
  # instantiated a group object&lt;br /&gt;
  my $groupObj = RT::Group-&amp;amp;gt;new($RT::SystemUser);&lt;br /&gt;
  $groupObj-&amp;amp;gt;LoadUserDefinedGroup($derivedGroupName);&lt;br /&gt;
  return undef unless $groupObj;&lt;br /&gt;
  &lt;br /&gt;
  # one doesn&amp;#039;t want to be a requestor and a Cc on the same ticket.&lt;br /&gt;
  # don&amp;#039;t add group as CC if requestor is in that group&lt;br /&gt;
  # this could certainly be a problem if there are multiple members in a group&lt;br /&gt;
  my $requestorsGroupObj = $self-&amp;amp;gt;TicketObj-&amp;amp;gt;Requestors;&lt;br /&gt;
  # UMO grabs group members in subgroups too it is recursive&lt;br /&gt;
  my $requestorsMembersObj = $requestorsGroupObj-&amp;amp;gt;UserMembersObj;&lt;br /&gt;
  &lt;br /&gt;
  my $userObj;&lt;br /&gt;
  while ($userObj = $requestorsMembersObj-&amp;amp;gt;Next) {&lt;br /&gt;
      if ($groupObj-&amp;amp;gt;HasMember($userObj-&amp;amp;gt;PrincipalObj)) {&lt;br /&gt;
          $RT::Logger-&amp;amp;gt;info(&amp;quot;Requestor &amp;#039;&amp;quot; . $userObj-&amp;amp;gt;Name .&lt;br /&gt;
              &amp;quot;&amp;#039; is in group &amp;#039;$derivedGroupName&amp;#039; not adding Cc on ticket #&amp;quot; .&lt;br /&gt;
              $self-&amp;amp;gt;TicketObj-&amp;amp;gt;id );&lt;br /&gt;
  &lt;br /&gt;
          return undef;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  # add group as Cc on ticket. see Ticket_Overlay.pm&lt;br /&gt;
  $RT::Logger-&amp;amp;gt;info(&amp;quot;Add group &amp;#039;$derivedGroupName&amp;#039; as Cc on ticket #&amp;quot; .&lt;br /&gt;
      $self-&amp;amp;gt;TicketObj-&amp;amp;gt;id );&lt;br /&gt;
  my ($success, $msg)= $self-&amp;amp;gt;TicketObj-&amp;amp;gt;AddWatcher(&lt;br /&gt;
                               Type =&amp;amp;gt; &amp;quot;Cc&amp;quot;,&lt;br /&gt;
                               PrincipalId =&amp;amp;gt; $groupObj-&amp;amp;gt;PrincipalId);&lt;br /&gt;
  &lt;br /&gt;
  if (! $success) {&lt;br /&gt;
   $RT::Logger-&amp;amp;gt;info($msg);&lt;br /&gt;
   return undef;&lt;br /&gt;
  } else {&lt;br /&gt;
   return 1;&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Custom action cleanup code:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# blank&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Include CC Tickets in SelfService ==&lt;br /&gt;
&lt;br /&gt;
After the Department head has been made CC on a ticket they need an easy way to view all such tickets. So, let&amp;#039;s modify [[SelfService]] to show them.&lt;br /&gt;
&lt;br /&gt;
Put the pieces in place:&lt;br /&gt;
&lt;br /&gt;
 [root@lakshmi Elements]# mkdir -p /usr/local/rt/html/SelfService/Elements&lt;br /&gt;
 [root@lakshmi Elements]# cp MyRequests /usr/local/rt/html/SelfService/Elements&lt;br /&gt;
&lt;br /&gt;
Make one small change.&lt;br /&gt;
&lt;br /&gt;
 [root@lakshmi Elements]# diff -u MyRequests /usr/local/rt/html/SelfService/Elements/MyRequests&lt;br /&gt;
 --- MyRequests  2005-02-01 06:20:40.000000000 -0800&lt;br /&gt;
 +++ /usr/local/rt/html/SelfService/Elements/MyRequests  2006-02-27 11:00:31.000000000 -0800&lt;br /&gt;
 @@ -70,7 +70,7 @@&lt;br /&gt;
  $title ||= loc(&amp;quot;My [_1] tickets&amp;quot;, $friendly_status);&lt;br /&gt;
  my $MyTickets;&lt;br /&gt;
  $MyTickets = new RT::Tickets ($session{&amp;#039;CurrentUser&amp;#039;});&lt;br /&gt;
 -$MyTickets-&amp;amp;gt;LimitWatcher(TYPE =&amp;amp;gt; &amp;#039;Requestor&amp;#039;, VALUE =&amp;amp;gt; $session{&amp;#039;CurrentUser&amp;#039;}-&amp;amp;gt;EmailAddress);&lt;br /&gt;
 +$MyTickets-&amp;amp;gt;LimitWatcher(VALUE =&amp;amp;gt; $session{&amp;#039;CurrentUser&amp;#039;}-&amp;amp;gt;EmailAddress);&lt;br /&gt;
  $MyTickets-&amp;amp;gt;OrderBy(FIELD =&amp;amp;gt; &amp;#039;id&amp;#039;, ORDER =&amp;amp;gt; &amp;#039;ASC&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
  foreach my $status (@status) {&lt;br /&gt;
&lt;br /&gt;
= Bugs in Solution =&lt;br /&gt;
&lt;br /&gt;
* If there is more than one user in a &amp;#039;Head X&amp;#039; group and one user opens a ticket, the other user will not become a Cc.&lt;br /&gt;
&lt;br /&gt;
This would in an issue in departments with more than one &amp;quot;head&amp;quot;. We can worry about that later. (Also see [[OnCreateAddGroupCc]].)&lt;br /&gt;
&lt;br /&gt;
* If the Department changes during the life of the ticket, the new Cc will be added, but the old Cc will not be removed.&lt;br /&gt;
&lt;br /&gt;
* How can send the [[AutoReply]] to the department head as well as the requestor?&lt;/div&gt;</summary>
		<author><name>208.70.50.7</name></author>
	</entry>
</feed>