<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello Vladislavs,</p>
    <p>just a quick try: your template mapping should be executed twice
      - once for "old" value of extension/adGroup and once for "new"
      value of it. So maybe what you see in the log is the first
      execution. Isn't there another execution, this time with the
      expected value?<br>
    </p>
    <p>Best regards,<br>
    </p>
    <pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
    <div class="moz-cite-prefix">On 08/04/2020 16:34, Vladislavs
      Filipciks wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:1897323719.1338095.1586356484269.JavaMail.zimbra@csolutions.lv">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div style="font-family: arial, helvetica, sans-serif; font-size:
        10pt; color: #000000">
        <div>Hello.</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>I'm having trouble mapping user extended schema property to
          another extended schema property during user import from
          resource. The source extension/property is always being null
          while object template is processed.</div>
        <div>Probably I'm missing some additional config or something.
          Could any one suggest/correct me? Config snips:</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>Resource:</div>
        <div>
          <!--StartFragment-->
          <div style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;" data-mce-style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;"><div><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">attribute</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">               </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">ref</span><span style="color: #808080;" data-mce-style="color: #808080;">></span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">ri:memberOf</span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">ref</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">               </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">inbound</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">expression</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                  </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">script</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                     </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">code</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                        if(input != null){</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                            tmpdn = input;</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                            groupPath = tmpdn.substring(0, tmpdn.indexOf(",DC="));</span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">           </span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                            log.info("-- adGroup from resource schemaHandling " + groupPath );</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                            return groupPath;</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                        }</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                    </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">code</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                  </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">script</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                 </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">expression</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">target</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                    </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">path</span><span style="color: #808080;" data-mce-style="color: #808080;">></span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">extension/adGroup</span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">path</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">target</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">            </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">inbound</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">           </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">attribute</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div></div>
          <!--EndFragment--> </div>
        <div><br>
        </div>
        <div>Extension schema:</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>
          <!--StartFragment-->
          <div style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;" data-mce-style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;"><div><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">xsd:complexType</span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;" data-mce-style="color: #9cdcfe;">name</span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">=</span><span style="color: #ce9178;" data-mce-style="color: #ce9178;">"UserExtensionType"</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">xsd:annotation</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">      </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">xsd:appinfo</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">        </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">a:extension</span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;" data-mce-style="color: #9cdcfe;">ref</span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">=</span><span style="color: #ce9178;" data-mce-style="color: #ce9178;">"c:UserType"</span><span style="color: #808080;" data-mce-style="color: #808080;">/></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">      </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">xsd:appinfo</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">xsd:annotation</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">xsd:sequence</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div></div>
          <!--EndFragment--> </div>
        <div><br data-mce-bogus="1">
        </div>
        <div>User template that is being used with sync:</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>
          <!--StartFragment-->
          <div style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;" data-mce-style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;"> <!--StartFragment--><div style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;" data-mce-style="color: #d4d4d4; background-color: #1e1e1e; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;"><div><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">mapping</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">name</span><span style="color: #808080;" data-mce-style="color: #808080;">></span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">Ad Group name mapping</span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">name</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">source</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">            </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">path</span><span style="color: #808080;" data-mce-style="color: #808080;">></span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">extension/adGroup</span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">path</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">source</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">expression</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">        </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">script</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">            </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">code</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                log.info('+++++++++++++++++ adGroup from user template ' + adGroup);</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                if ((groupName = adGroup.split(",CN=")[0].substring(3))){</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                return groupName.trim();</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                }</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                groupName = adGroup.split(",OU=")[0].substring(3);</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                log.info('++++++ gorupName from user template ' + groupName);</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">                return groupName.trim();</span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">            </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">code</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">        </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">script</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">expression</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">target</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">          </span><span style="color: #808080;" data-mce-style="color: #808080;"><</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">path</span><span style="color: #808080;" data-mce-style="color: #808080;">></span><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">extension/groupName</span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">path</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">    </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">target</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div><div><span style="color: #d4d4d4;" data-mce-style="color: #d4d4d4;">   </span><span style="color: #808080;" data-mce-style="color: #808080;"></</span><span style="color: #569cd6;" data-mce-style="color: #569cd6;">mapping</span><span style="color: #808080;" data-mce-style="color: #808080;">></span></div></div></div>
          <!--EndFragment--> </div>
        <div><br data-mce-bogus="1">
        </div>
        <div>Log:</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>
          <div><span style="font-size: 13.3333px;"
              data-mce-style="font-size: 13.3333px;">2020-04-08
              17:31:28,495 [MODEL] [http-nio-8080-exec-4] INFO
              (com.evolveum.midpoint.expression): -- adGroup from
              resource schemaHandling CN=Midpoint Test Group,OU=Midpoint
              Test OU,OU=CS_group_users</span></div>
          <div><span style="font-size: 13.3333px;"
              data-mce-style="font-size: 13.3333px;">2020-04-08
              17:31:28,496 [MODEL] [http-nio-8080-exec-4] INFO
              (com.evolveum.midpoint.expression): -- adGroup from
              resource schemaHandling CN=Domain Admins,CN=Users</span></div>
          <div><span style="font-size: 13.3333px;"
              data-mce-style="font-size: 13.3333px;">2020-04-08
              17:31:28,500 [MODEL] [http-nio-8080-exec-4] INFO
              (com.evolveum.midpoint.expression): -- adOUContainer from
              resource schemaHandling OU=Midpoint Test
              OU,OU=CS_group_users</span></div>
          <div><span style="font-size: 13.3333px;"
              data-mce-style="font-size: 13.3333px;">2020-04-08
              17:31:28,515 [MODEL] [http-nio-8080-exec-4] INFO
              (com.evolveum.midpoint.expression): +++++++++++++++++
              adGroup from user template null</span></div>
        </div>
        <div><br>
        </div>
        <div><br data-mce-bogus="1">
        </div>
        <div><br data-mce-bogus="1">
        </div>
        <div data-marker="__SIG_PRE__">
          <p style="margin: 0px; font-stretch: normal; font-size: 18px;
            line-height: normal; font-family: 'arial';"
            data-mce-style="margin: 0px; font-stretch: normal;
            font-size: 18px; line-height: normal; font-family: 'arial';"><b>Vladislavs
              Fiļipčiks</b></p>
          <p style="margin: 0px; font-stretch: normal; font-size: 14px;
            line-height: normal; font-family: 'arial';"
            data-mce-style="margin: 0px; font-stretch: normal;
            font-size: 14px; line-height: normal; font-family: 'arial';">+371
            6784 7766</p>
          <p style="margin: 0px; font-stretch: normal; font-size: 14px;
            line-height: normal; font-family: 'arial';"
            data-mce-style="margin: 0px; font-stretch: normal;
            font-size: 14px; line-height: normal; font-family: 'arial';"><b>SIA
              “Corporate Solutions”</b></p>
          <p style="margin: 0px; font-stretch: normal; font-size: 14px;
            line-height: normal; font-family: 'arial';"
            data-mce-style="margin: 0px; font-stretch: normal;
            font-size: 14px; line-height: normal; font-family: 'arial';">Pērnavas
            43A-9, Rīga, LV-1009</p>
          <p style="margin: 0px; font-stretch: normal; font-size: 14px;
            line-height: normal; font-family: 'arial'; color: #807f7f;"
            data-mce-style="margin: 0px; font-stretch: normal;
            font-size: 14px; line-height: normal; font-family: 'arial';
            color: #807f7f;"><span style="text-decoration: underline;
              color: #999999;" data-mce-style="text-decoration:
              underline; color: #999999;"><a
                href="http://www.csolutions.lv/" style="color: #999999;
                text-decoration: underline;" target="_blank"
                rel="nofollow noopener noreferrer"
                data-mce-style="color: #999999; text-decoration:
                underline;" moz-do-not-send="true">www.csolutions.lv</a></span><br>
          </p>
          <p style="margin: 0px; font-stretch: normal; font-size: 12px;
            line-height: normal; font-family: 'arial'; min-height:
            14px;" data-mce-style="margin: 0px; font-stretch: normal;
            font-size: 12px; line-height: normal; font-family: 'arial';
            min-height: 14px;"><br>
            <img
src="https://drive.google.com/uc?export=view&id=1WuHLZnuvRtyBe4lBkMiUhpEYoRjH4eUH"
              moz-do-not-send="true" width="140" height="46"></p>
          <p style="margin: 0px; font-stretch: normal; font-size: 10px;
            line-height: normal; font-family: 'arial'; color: #4c4c4c;"
            data-mce-style="margin: 0px; font-stretch: normal;
            font-size: 10px; line-height: normal; font-family: 'arial';
            color: #4c4c4c;"><span style="color: #999999;"
              data-mce-style="color: #999999;">Šis e-pasts un tā
              pielikumā esošie dokumenti var saturēt ierobežotas
              pieejamības informāciju, cita starpā fizisko personu
              datus, kas adresēta tikai tā saņēmējam un izmantojama
              tikai leģitīmiem mērķiem. Ja esat saņēmis šo e-pastu
              kļūdas dēļ, vai nav pamatota mērķa ierobežotas pieejamības
              informācijas, cita starpā fizisko personu datu, apstrādei,
              Jums nav tiesību izmantot vai pārsūtīt šajā e-pastā un tam
              pievienotajos dokumentos ietverto informāciju. Šādā
              gadījumā nekavējoties neatgriezeniski izdzēsiet šo
              e-pastu.</span></p>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
  </body>
</html>