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.
I came up with this today, I hope it helps someone!
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
Delete the value in the ticket's Fix Version/s field.
This situation arises because of two things:
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 Docs ScriptRunner for Jira Server
-Brittany
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.