Answers: <p>Atlassian Labs have now provided this functionality as an add-on: <a href="https://marketplace.atlassian.com/apps/1219706/conditional-tasks-for-bamboo?hosting=server&amp;tab=overview" rel="nofollow noreferrer">https://marketplace.atlassian.com/apps/1219706/conditional-tasks-for-bamboo?hosting=server&amp;tab=overview</a></p>
  <p>Only available for versions 6.7.1+</p>
  <p><strong>Update:</strong></p>
  <p>This add-on is only supported up to Bamboo 7.0.6 and conditional tasks are a standard feature in Bamboo 7.1+</p>
  <p><a href="https://confluence.atlassian.com/bamboo/bamboo-7-1-release-notes-1013854809.html" rel="nofollow noreferrer">https://confluence.atlassian.com/bamboo/bamboo-7-1-release-notes-1013854809.html</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2019-07-31T16:55:16.220Z
Answers: 2021-06-11T08:40:00.117Z
Answers: 2021-06-11T08:40:00.117Z
Answers: Thomas Minney
Answers: <p>I don't know if there is some GUI way to do this</p>
  <p>I am triggering the same plan in different ways from a REST request by using a variable</p>
  <p>To do this</p>
  <ol>
  <li>define a variable in the plan configuration variables ie <code>myvariable</code></li>
  <li>in the REST request set <code>bamboo.variable.myvariable</code> to the value required ie &quot;1&quot; or &quot;2&quot;</li>
  <li>in the plan stage add a task of script and use the variable as <code>$bamboo_myvariable</code> for instance</li>
  </ol>
  <pre><code>if [ &quot;$bamboo_myvariable&quot; == &quot;1&quot; ]; then 
     # stuff to do variation 1
  fi
  if [ &quot;$bamboo_myvariable&quot; == &quot;2&quot; ]; then
     # suff to do variation 2
  fi     
  </code></pre>
  <p>If you want to alter behaviour by branch there are variables such as &quot;bamboo_planRepository_1_branch&quot; which are available by default and could be used ina  similar way</p>
  
Answers: CC BY-SA 4.0
Answers: 2018-02-08T15:24:08.223Z
Answers: 2024-04-29T19:10:52.277Z
Answers: 2024-04-29T19:10:52.277Z
Answers: Vorsprung
Body: <p>For example, by branch name you might want to execute different tasks (regress testing in release branches instead of massive integration tests for example).</p>
  
  <p>Is there a mechanism to do that in Bamboo's UI?</p>
  
Comments: CC BY-SA 3.0
Comments: 2018-01-29T09:29:30.650Z
Comments: You could create separate build plans and have each of them trigger on a different set of branches (see the plan branches settings).
Comments: Byte Commander
Tags: <bamboo>
Title: Is it possible to design conditionally executed tasks in Bamboo?
UserDisplayName: Ta Mu
ThreadText: # Is it possible to design conditionally executed tasks in Bamboo?
  
  (Asked by: username_0 on 2017-09-18)
  
  For example, by branch name you might want to execute different tasks (regress testing in release branches instead of massive integration tests for example).
  
  Is there a mechanism to do that in Bamboo's UI?
  
  **Tags:** bamboo
  
  > **Comments:**
  > **username_1**: You could create separate build plans and have each of them trigger on a different set of branches (see the plan branches settings).  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2018-02-08. Score: 3 | Accepted answer
  
  I don't know if there is some GUI way to do this
  
  I am triggering the same plan in different ways from a REST request by using a variable
  
  To do this
  
  1. define a variable in the plan configuration variables ie `myvariable`
  2. in the REST request set `bamboo.variable.myvariable` to the value required ie "1" or "2"
  3. in the plan stage add a task of script and use the variable as `$bamboo_myvariable` for instance
  
  ```
  if [ "$bamboo_myvariable" == "1" ]; then 
     # stuff to do variation 1
  fi
  if [ "$bamboo_myvariable" == "2" ]; then
     # suff to do variation 2
  fi     
  
  ```
  
  If you want to alter behaviour by branch there are variables such as "bamboo\_planRepository\_1\_branch" which are available by default and could be used ina similar way
  
  
  ---
  
  ### Answer by username_2 on 2019-07-31. Score: 3
  
  Atlassian Labs have now provided this functionality as an add-on: <https://marketplace.atlassian.com/apps/1219706/conditional-tasks-for-bamboo?hosting=server&tab=overview>
  
  Only available for versions 6.7.1+
  
  **Update:**
  
  This add-on is only supported up to Bamboo 7.0.6 and conditional tasks are a standard feature in Bamboo 7.1+
  
  <https://confluence.atlassian.com/bamboo/bamboo-7-1-release-notes-1013854809.html>
  
  
  ---
  
  