Attachment Author attributes don't carry over when cloning an issue?

david-guild November 5, 2019

Hello All,

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?

1 answer

0 votes
Leo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 6, 2019

Hi @david-guild

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

 

BR,

Leo

david-guild November 6, 2019

Hi Leo, 

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.

Suggest an answer

Log in or Sign up to answer