Snippets

Adaptavist Script Listiner Conditions Jira Cloud

Updated by Kristian Walker

File ScriptListinerConditionsJiraCloud.groovy Modified

  • Ignore whitespace
  • Hide word diff
  // The issue binding must be in the context for the event this webhook is running as in order to use this condition.
  issue.customfield_12345.value =="Test" // Note here you should change customfield_12345 to be the ID of your custom field and change the value Test to be the value you want to match 
  
- // Ensure an issue has a specific label. 
+ // Ensure an issue has a specific label and only run the listiner code if it does.
+ // The issue binding must be in the context for the event this webhook is running as in order to use this condition.
 issue.labels.includes("myLabel")
Updated by Kristian Walker

File ScriptListinerConditionsJiraCloud.groovy Modified

  • Ignore whitespace
  • Hide word diff
  
  // Ensure that the value in a single select list field is a specified value. 
  // The issue binding must be in the context for the event this webhook is running as in order to use this condition.
- issue.customfield_12345.value =="Test" // Note here you should change customfield_12345 to be the ID of your custom field and change the value Test to be the value you want to match
+ issue.customfield_12345.value =="Test" // Note here you should change customfield_12345 to be the ID of your custom field and change the value Test to be the value you want to match 
+ 
+ // Ensure an issue has a specific label. 
+issue.labels.includes("myLabel")
Created by Kristian Walker

File ScriptListinerConditionsJiraCloud.groovy Added

  • Ignore whitespace
  • Hide word diff
+/*
+ * "These lines of code can be added to the Conditions box in a Script Listiner on Jira Cloud in order to specify a condition that must return true before the code for a script listiner is run
+ * All right, title and interest in this code snippet shall remain the exclusive intellectual property of Adaptavist Group Ltd and its affiliates. Customers with a valid ScriptRunner 
+ * license shall be granted a  non-exclusive, non-transferable, freely revocable right to use this code snippet only within their own instance of Atlassian products. This licensing notice cannot be removed
+ * or amended and must be included in any circumstances where the code snippet is shared by You or a third party." 
+ */
+ 
+ // Ensure that the first value in a multi select list field is a specified value
+ // The issue binding must be in the context for the event this webhook is running as in order to use this condition.
+issue.customfield_12345[0].value =="Test" // Note here you should change customfield_12345 to be the ID of your custom field and change the value Test to be the value you want to match
+ 
+ // Ensure that the value in a single select list field is a specified value. 
+ // The issue binding must be in the context for the event this webhook is running as in order to use this condition.
+ issue.customfield_12345.value =="Test" // Note here you should change customfield_12345 to be the ID of your custom field and change the value Test to be the value you want to match
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.