It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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 Nov 06, 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

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
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

314 views 1 3
Join discussion

Community Events

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

Events near you