Snippets

Adaptavist Jira Cloud Create Sub Task Post Function Additional Code Examples

Updated by Kristian Walker

File CreateSubTaskGetAssigneeFromParentAdditionalCode.groovy Deleted

  • Ignore whitespace
  • Hide word diff
-/*
- * "The code examples below should be added to the 'Additional Code' box on the Create subtask postfunction in order to set the assignee on the subtask to the assignee of the parent issue 
- * 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." 
- */
-
-// -------- Set the assignee to the assignee from the parent issue --------
-
-// Get the assignee's Account Id from the parent issue
-def parentIssueAssignee = issue.fields.assignee.accountId
-// Define the map required to set the assignee using their Account ID
-def user = [id: parentIssueAssignee] as Map
-// Set the assignee of the subtask
-subtask.fields.assignee = user 
-//--------------------------------------------------------------------------------
-
-// -------- Set the subtask summary to the summary of the parent issue with some extra text appended to it --------
-// Define the extra text to append to the Summary field
-def stringToAppend = " My extra text to append to the summary"
-// Set the Summary of the subtask to the Sumamry of the parent issue and then append the additionl text onto the end of it. 
-subtask.fields.summary = issue.fields.summary + stringToAppend.toString()
-//--------------------------------------------------------------------------------

File CreateSubTaskPostFunctionAdditionalCodeExamples.groovy Added

  • Ignore whitespace
  • Hide word diff
+/*
+ * "The code examples below should be added to the 'Additional Code' box on the Create subtask postfunction in order to set the assignee on the subtask to the assignee of the parent issue 
+ * 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." 
+ */
+
+// -------- Set the assignee to the assignee from the parent issue --------
+
+// Get the assignee's Account Id from the parent issue
+def parentIssueAssignee = issue.fields.assignee.accountId
+// Define the map required to set the assignee using their Account ID
+def user = [id: parentIssueAssignee] as Map
+// Set the assignee of the subtask
+subtask.fields.assignee = user 
+//--------------------------------------------------------------------------------
+
+// -------- Set the subtask summary to the summary of the parent issue with some extra text appended to it --------
+// Define the extra text to append to the Summary field
+def stringToAppend = " My extra text to append to the summary"
+// Set the Summary of the subtask to the Sumamry of the parent issue and then append the additionl text onto the end of it. 
+subtask.fields.summary = issue.fields.summary + stringToAppend.toString()
+//--------------------------------------------------------------------------------
Updated by Kristian Walker

File CreateSubTaskGetAssigneeFromParentAdditionalCode.groovy Modified

  • Ignore whitespace
  • Hide word diff
 /*
- * "The code below should be added to the 'Additional Code' box on the Create subtask postfunction in order to set the assignee on the subtask to the assignee of the parent issue 
+ * "The code examples below should be added to the 'Additional Code' box on the Create subtask postfunction in order to set the assignee on the subtask to the assignee of the parent issue 
  * 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." 
  */
 
+// -------- Set the assignee to the assignee from the parent issue --------
+
 // Get the assignee's Account Id from the parent issue
 def parentIssueAssignee = issue.fields.assignee.accountId
 // Define the map required to set the assignee using their Account ID
 def user = [id: parentIssueAssignee] as Map
 // Set the assignee of the subtask
-subtask.fields.assignee = user
+subtask.fields.assignee = user 
+//--------------------------------------------------------------------------------
+
+// -------- Set the subtask summary to the summary of the parent issue with some extra text appended to it --------
+// Define the extra text to append to the Summary field
+def stringToAppend = " My extra text to append to the summary"
+// Set the Summary of the subtask to the Sumamry of the parent issue and then append the additionl text onto the end of it. 
+subtask.fields.summary = issue.fields.summary + stringToAppend.toString()
+//--------------------------------------------------------------------------------
Updated by Kristian Walker

File CreateSubTaskGetAssigneeFromParentAdditionalCode.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." 
  */
 
-// Get the assignee from the parent issue
-def parentIssueAssignee = issue.fields.assignee.name
-// Define the map required to set the assignee
-def user = [name: parentIssueAssignee] as Map
+// Get the assignee's Account Id from the parent issue
+def parentIssueAssignee = issue.fields.assignee.accountId
+// Define the map required to set the assignee using their Account ID
+def user = [id: parentIssueAssignee] as Map
 // Set the assignee of the subtask
 subtask.fields.assignee = user
Updated by Kristian Walker

File CreateSubTaskGetAssigneeFromParentAdditionalCode.groovy Modified

  • Ignore whitespace
  • Hide word diff
  */
 
 // Get the assignee from the parent issue
-def parentIssueAssignee = issue.fields.assignee.key
+def parentIssueAssignee = issue.fields.assignee.name
 // Define the map required to set the assignee
 def user = [name: parentIssueAssignee] as Map
 // Set the assignee of the subtask
Created by Kristian Walker

File CreateSubTaskGetAssigneeFromParentAdditionalCode.groovy Added

  • Ignore whitespace
  • Hide word diff
+/*
+ * "The code below should be added to the 'Additional Code' box on the Create subtask postfunction in order to set the assignee on the subtask to the assignee of the parent issue 
+ * 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." 
+ */
+
+// Get the assignee from the parent issue
+def parentIssueAssignee = issue.fields.assignee.key
+// Define the map required to set the assignee
+def user = [name: parentIssueAssignee] as Map
+// Set the assignee of the subtask
+subtask.fields.assignee = user
HTTPS SSH

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