Snippets

Adaptavist Adaptavist ScriptRunner for Jira Cloud Example Workflow Validators

Updated by Kristian Walker

File ScriptRunnerforJiraCloudExampleWorkflowValidatorss.groovy Modified

  • Ignore whitespace
  • Hide word diff
 
 // Specify that both select list drop downs in a custom cascading select field must be populated in order to create an issue. 
 // Note: You should replace 'customfield_10093' in the example below with the ID of the cascading select list field inside of your instance. 
-issue.customfield_10093.child.value.length >0 // You may also want to set the Error message to have text similar to 'You must specify a value in both of the Cascading Select List field drop downs in order to be able to create this issue.'
+issue.customfield_10093.child.value.length >0 // You may also want to set the Error message to have text similar to 'You must specify a value in both of the Cascading Select List field drop downs in order to be able to create this issue.'
+
+// Specify that All Sub Tasks must be in the 'In Progress' status before the parent issue can be transitioned
+issue.subtasks.filter(subtask => subtask.status.name == 'In Progress').length == issue.subtasks.length // You may also want to set the Error message to have text similar to 'All subtasks must be in the In Progress status before this parent issue can be transitioned.'
Updated by Kristian Walker

File ScriptRunnerforJiraCloudExampleWorkflowValidatorss.groovy Modified

  • Ignore whitespace
  • Hide word diff
 */ 
 
 // Speicify that at least one linked issue must be entered when the issue is created 
-issue.links.length >0 // You may also want to set the Error message to have text similar to 'You must specify at least one linked issue in order to be able to create this issue.'
+issue.links.length >0 // You may also want to set the Error message to have text similar to 'You must specify at least one linked issue in order to be able to create this issue.'
+
+// Specify that both select list drop downs in a custom cascading select field must be populated in order to create an issue. 
+// Note: You should replace 'customfield_10093' in the example below with the ID of the cascading select list field inside of your instance. 
+issue.customfield_10093.child.value.length >0 // You may also want to set the Error message to have text similar to 'You must specify a value in both of the Cascading Select List field drop downs in order to be able to create this issue.'
Updated by Kristian Walker

File ScriptRunnerforJiraCloudExampleWorkflowValidatorss.groovy Modified

  • Ignore whitespace
  • Hide word diff
 /*
- * This script provides some example conditions which can be added as 'ScriptRunner Script Validators* inside of ScriptRunner for Jira Cloud'.
+ * This script provides some example expressions which can be added as 'ScriptRunner Script Validators* 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
Created by Kristian Walker

File ScriptRunnerforJiraCloudExampleWorkflowValidatorss.groovy Added

  • Ignore whitespace
  • Hide word diff
+/*
+ * This script provides some example conditions which can be added as 'ScriptRunner Script Validators* 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
+ * or amended and must be included in any circumstances where the code snippet is shared by You or a third party." 
+*/ 
+
+// Speicify that at least one linked issue must be entered when the issue is created 
+issue.links.length >0 // You may also want to set the Error message to have text similar to 'You must specify at least one linked issue in order to be able to create this issue.'
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
HTTPS SSH

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