Hello and welcome in the community.
To do this you'll need to get a plugin. They're plenty of plugin to do this (I would suggest Automation or Scriptrunner but others tools can do the trick too)
When you'll get the plugin you looking for you got two solution, with automation, you build an automatisation to copy this to the child issue ( not hard to do ) OR with other plugins set the copy into the workflow in a postfunction.
Hope this help .
Florian
i have script runner can you help me in code to copying the attachments to subtasks
and where to be written as well
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, better I can do for the moment is suggest you 2 scripts from my library :
All this code must be adapted and set in a postfunction in the workflow.
https://support.atlassian.com/jira-cloud-administration/docs/configure-advanced-issue-workflows/
https://scriptrunner.adaptavist.com/latest/jira/tutorials/scripted-post-functions-tutorial.html
Hope this help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian,
the script is working perfectly thanks :)
One more sscript is running to copy all the attachments from subtasks to Parent .So i need to make unique while attaching the script from subtask to parent .
code from subtask to parent :
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.AttachmentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.attachment.Attachment
import com.atlassian.jira.user.ApplicationUser
ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
Issue parentIssue = issue.getParentObject()
AttachmentManager attachmentManager = ComponentAccessor.getAttachmentManager()
Collection<Attachment> attachments = issue.getAttachments()
attachments.each{
attachmentManager.copyAttachment(it, currentUser, parentIssue.getKey())
}
If the attachment is already there , then that should not copy .
Can you help in how to achieve this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @kiranmai_genkolla and @Florian PEREZ [Valiantys Administrator]
Thanks a lot for the shares. I am very new to groovy script and need help with something.
How can I use a script to copy the data from the attachment attached to an issue to a custom field on the task?
Thanks for help .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.