Snippets

Adaptavist Jira Cloud Clone an Issue Post Function Additional Actions

Updated by Kristian Walker

File JiraCloudCloneIssuePFSkipAttachments.groovy Modified

  • Ignore whitespace
  • Hide word diff
 
 // Remove the value from a select list field when cloning the issue.  
 // Change customfield_10072 below to be the ID of your Select List Field
-issueInput.fields.remove("customfield_10072")
+issueInput.fields.remove("customfield_10072")
+
+// Clear the assignee field when cloning an issue
+issueInput.fields.assignee = null
Updated by Kristian Walker

File JiraCloudCloneIssuePFSkipAttachments.groovy Modified

  • Ignore whitespace
  • Hide word diff
 // Remove a certain attachment in the list. - The example below would remove the 2nd attacment on an issue
 issue.fields.attachment.removeAt(2) 
 
-// Clone the Epic Link Value
-issueInput.fields.customfield_10008 = issue.fields.customfield_10008 // Note here you will need to change the customfield_10008 value to be the value of the Epic Link field inside of your isntance. 
+// Clone the Epic Link Value. 
+//Change customfield_10008 below to be the ID of your Epic Link Field
+issueInput.fields.customfield_10008 = issue.fields.customfield_10008 // Note here you will need to change the customfield_10008 value to be the value of the Epic Link field inside of your isntance. 
+
+// Remove the value from a select list field when cloning the issue.  
+// Change customfield_10072 below to be the ID of your Select List Field
+issueInput.fields.remove("customfield_10072")
Updated by Kristian Walker

File JiraCloudCloneIssuePFSkipAttachments.groovy Modified

  • Ignore whitespace
  • Hide word diff
 /*
- * "These two lines of code can be added to the Additioanl Code box in the Clone an Issue Post Function on Jira Cloud to skip cloning either all attachments or some attachments
+ * "These lines of code can be added to the Additioanl Code box in the Clone an Issue Post Function on Jira Cloud to perform additonal tasks
  * 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." 
 issue.fields.attachment.clear()
 
 // Remove a certain attachment in the list. - The example below would remove the 2nd attacment on an issue
-//issue.fields.attachment.removeAt(2) 
+issue.fields.attachment.removeAt(2) 
+
+// Clone the Epic Link Value
+issueInput.fields.customfield_10008 = issue.fields.customfield_10008 // Note here you will need to change the customfield_10008 value to be the value of the Epic Link field inside of your isntance. 
Updated by Kristian Walker

File JiraCloudCloneIssuePFSkipAttachments.groovy Modified

  • Ignore whitespace
  • Hide word diff
 issue.fields.attachment.clear()
 
 // Remove a certain attachment in the list. - The example below would remove the 2nd attacment on an issue
-issue.fields.attachment.removeAt(2) 
+//issue.fields.attachment.removeAt(2) 
Created by Kristian Walker

File JiraCloudCloneIssuePFSkipAttachments.groovy Added

  • Ignore whitespace
  • Hide word diff
+/*
+ * "These two lines of code can be added to the Additioanl Code box in the Clone an Issue Post Function on Jira Cloud to skip cloning either all attachments or some attachments
+ * 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." 
+ */
+
+// Remove all attachments
+issue.fields.attachment.clear()
+
+// Remove a certain attachment in the list. - The example below would remove the 2nd attacment on an issue
+issue.fields.attachment.removeAt(2) 
HTTPS SSH

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