I am currently using Scriptrunner to clone an issue and attachments on a particular transition. Works great .. except I just discovered that the Attachment "Author" is not carrying over to the cloned issue attachment.
This is causing an issue, as the author is not able to delete the attachment in the clone.
Scriptrunner doesn't appear to allow me to remedy this situation. I can't even tell it to "not" copy the attachments so I can do it via custom script.
I was thinking to write yet another listener to "fix" this problem, but I could not find any method that would allow me to modify the attributes (add an author) to the attachment itself.
I am guessing my only recourse is to do a full custom object that handles the cloning, and all the details like attachments and their author meta data, and just not use scriptrunner for this operation?
Can anybody suggest any other solutions?
You can try out the the scriptrunner's Clone issue custom listener on a particular events
just add your condition to check the transitioned status
which will provide you options to select particular fields to copy to targeted/cloned issue
That is what I am doing. Using the Scriptrunner "clone an issue and links" on event. The event is "issue resolved" (which I refer to as an transition ... from not resolved to resolved).
Yes, I have selected "copy all fields".
An Attachment "author" is not a core field, nor is it a custom field. It appears to be an "attribute set" that carry's fields such as AvatarUrls, timeZone, name, emailAddress, etc, etc).
When you clone an issue in Jira proper, the Author attribute set appears to copy over with the attachment.
When you use Scriptrunner to clone the issue, the Author attribute set DOES NOT copy over.
You should be able to easily test this.
Create an issue
Add an attachment
Use the scriptrunner to create a clone
Hit both issues (original + clone) with an API call
Look at the attachment section ... you *should* see there are different.
Clone the issue again, using native jira, check it against the original ... they *should* be the same. And both will be "different" then the scriptrunner cloned issue.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events