Configuration of includedRegions in Jenkinsfile?
<p>How can I limit the scope of a Jenkins pipeline project to only be built if a file in specific subdirectory is changed using <code>Jenkinsfile</code>?</p>

<p>I have a single Git repository with two directories. Each directory contains a separate subproject and I would like to build each subproject separately by Jenkins using <code>Jenkinsfile</code>. The project has the following file structure:</p>

<pre><code>parent
 |
 +- subA
 |   |
 |   + Jenkinsfile
 |   + more files related to sub project A
 |
 +- subB
     |
     + Jenkinsfile
     + more files related to sub project B
</code></pre>

<p>The <code>Jenkinsfile</code> for <code>subA</code> has the following configuration:</p>

<pre><code>checkout scm: [
    $class: 'GitSCM',
    branches: [[name: '*/master']],
    userRemoteConfigs: [[url: 'https://[path]/parent.git']],
    extensions: [[
        $class: 'PathRestriction', includedRegions: 'subA/.*'
    ]]
]
</code></pre>

<p>The <code>Jenkinsfile</code> for <code>subB</code> is similar, the only difference being that it has specified <code>subB</code> as <code>includedRegions</code>.</p>

<p>In the Jenkins server, I have created two pipeline projects and pointed them to each <code>Jenkinsfile</code> respectively. If a file is changed in the folder <code>subA</code>, Jenkins pipeline project A is triggered and if a file is changed in folder <code>subB</code>, Jenkins pipeline project B is triggered, which is what I expect.</p>

<p>The problem is that the Jenkins pipeline project A is also triggered if a file is changed in <code>subB</code> and vice versa. </p>

<p>Jenkins version: 2.3</p>

<hr>

<p>Note: 
Configuring the setting <code>Additional Behaviours</code> -> <code>Polling ignores commits in certain paths</code> -> <code>Included Regions</code> to <code>subA/.*</code> or <code>subB/.*</code> respectively in the old Jenkins (ver 1.649) GUI results in the expected behavior.</p>

<hr>

<p>Update:</p>

<p>Adding <code>excludedRegions</code> to the Jenkinsfiles, e.g.</p>

<pre><code>checkout scm: [
    $class: 'GitSCM',
    branches: [[name: '*/master']],
    userRemoteConfigs: [[url: 'https://[path]/parent.git']],
    extensions: [[
        $class: 'PathRestriction', excludedRegions: '', includedRegions: 'subA/.*'
    ]]
]
</code></pre>

<p>does not change the behavior. Both subprojects are still rebuilt, despite files are only changed in one subdirectory.</p>