Removing Fix Version value when issue is cloned?

Laci June 22, 2021

Is there a way to remove values from select fields when you clone an issue? We are specifically trying to remove the Fix Version from issues when they are cloned.

I do have scriptrunner in my Jira instance if that helps. I have been looking for a script to do this in a post function, but haven't been able to find anything that doesn't deal with custom fields and since Fix Version is a system field, they aren't working.

2 answers

0 votes
Mel DuPont March 17, 2023

I came up with this today, I hope it helps someone!

 

Locating Hidden Cloned Tickets in Jira

If you clone a Released ticket in Jira, that ticket might not appear on your Board.

Here is a query that finds "hidden" cloned tickets in the XYZ project:

https://<server>/issues/?jql=project%20%3D%20XYZ%20AND%20status%20not%20in%20(Done%2CCanceled)%20AND%20fixVersion%20is%20not%20EMPTY%20ORDER%20BY%20updated%20DESC

 

To fix a cloned ticket:

Delete the value in the ticket's Fix Version/s field.

 

More Information

This situation arises because of two things:

  1. When you clone a Released ticket, the clone retains the original ticket's Fix Version/s value. (It probably shouldn't, but in Jira version 8.20.13, it does.)
  2. Our Board is configured to show only "fixVersion in unreleasedVersions() OR fixVersion is EMPTY".
0 votes
Brittany Wispell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 22, 2021

 Hey @Laci 

A similar use case can be found here: Update Fix Version through Script Listener.

Since cloning takes all aspects of the ticket you'll need to set up a script listener to look for 'If the ticket is a 'Cloned Issue' then remove the Fix Version. 

I do not recommend putting a post function in the workflow as you could run into issues with newly created tickets. And when an issue is 'Cloned' it goes through the create process again like a brand new issue. 

Let me know if you have any further questions! :)

Adaptavist Library 

Adaptavist Docs ScriptRunner for Jira Server 

-Brittany

Laci June 22, 2021

@Brittany Wispell The post function doesn't really matter for us as the particular issue type we are interested in shouldn't have a Fix Version upon creation anyway... It requires a review process.

As for the issue you've shared above, it doesn't seem like that would work for my use case. You'll have to forgive me, I'm not really one for writing code, I'm just an implementer so any assistance you could provide is very much appreciated.

Laci June 22, 2021

I have tried using this script from the Adaptivist Library and it throws a lot of errors and will not work.

https://library.adaptavist.com/entity/copy-field-value-from-linked-issue

Suggest an answer

Log in or Sign up to answer