Snippets

Adaptavist ScriptRunner for Jira Cloud Example Workflow Conditions

Updated by Kristian Walker

File ScriptRunnerforJiraCloudExampleWorkflowConditions.groovy Modified

  • Ignore whitespace
  • Hide word diff
 /*
- * This script provides some example conditions which can be added as 'ScriptRunner Script Conditions* inside of ScriptRunner for Jira Cloud'.
+ * This script provides some example expressions which can be added as 'ScriptRunner Script Conditions* inside of ScriptRunner for Jira Cloud'.
  * The conditions must written as a Jira Expression using the expression framework which Atlassian document at: https://developer.atlassian.com/cloud/jira/platform/jira-expressions/
  * 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
Updated by Kristian Walker

File ScriptRunnerforJiraCloudExampleWorkflowConditions.groovy Modified

  • Ignore whitespace
  • Hide word diff
 /*
  * This script provides some example conditions which can be added as 'ScriptRunner Script Conditions* inside of ScriptRunner for Jira Cloud'.
- * The conditions are wrote as Jira 
+ * The conditions must written as a Jira Expression using the expression framework which Atlassian document at: https://developer.atlassian.com/cloud/jira/platform/jira-expressions/
  * 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." 
 */
 
+// We also have some example conditions for script listiners  at http://scriptrunner-docs.connect.adaptavist.com/jiracloud/script-listeners.html#_evaluate_condition 
+// which  could be used as a reference guide to create workflow conditions. 
+
 
 // The example below mandates that an issue must have at least PDF attachment. 
 issue.attachments.filter(attachment => attachment.mimeType == 'application/pdf').length > 0 
 
-
+// Specify that the current user must be in a list of users baased
+['accountIdHere', 'accountIdHere'].includes(user.accountId)
Updated by Kristian Walker

File ScriptRunnerforJiraCloudExampleWorkflowConditions.groovy Modified

  • Ignore whitespace
  • Hide word diff
  * or amended and must be included in any circumstances where the code snippet is shared by You or a third party." 
 */
 
+
+// The example below mandates that an issue must have at least PDF attachment. 
+issue.attachments.filter(attachment => attachment.mimeType == 'application/pdf').length > 0 
+
+
Created by Kristian Walker

File ScriptRunnerforJiraCloudExampleWorkflowConditions.groovy Added

  • Ignore whitespace
  • Hide word diff
+/*
+ * This script provides some example conditions which can be added as 'ScriptRunner Script Conditions* inside of ScriptRunner for Jira Cloud'.
+ * The conditions are wrote as Jira 
+ * 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." 
+*/
+
  1. 1
  2. 2
HTTPS SSH

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