Hi,
I'm using script runner 'Clones an issue and links' to clone an issue.
How can I exclude cusotme fields and non custome fields from being cloned?
What is the syntax to use in the "Additional issue actions" box?
Thanks.
if field is custom
import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.ComponentManager ComponentManager componentManager = ComponentManager.getInstance() CustomFieldManager customFieldManager = componentManager.getCustomFieldManager() def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'CustomFieldName'} issue.setCustomFieldValue(cf, null)
You need to just null out the fields you don't want to copy, eg
issue.assignee = null
etc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would think it can... What code did you use?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jamie, did you ever determine if this was actually possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Sprint'}
issue.setCustomFieldValue(cf, null);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes... just zero out any field you don't want copied.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I also tried to apply this on the scriptrunner listener but it doesn't work.
I copied kate lines to "Clones an issue, and links" additional. can you please explain how you did it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you Define the Custom field manager first?
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Sprint'}
issue.setCustomFieldValue(cf, null);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Clone Plus Plugin for JIRA provides options for customizing clone operations including field excludes. This provides issue actions (not workflow functions) that can help with some team work flows that don't need to be associated with a issue transition.
Create on Transition Plugin for JIRA does provide workflow functions for creating issues and subtasks with control over which fields get copied to the new issue. Not exactly cloning but with most of the same capability.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The clone in groovy effectively calls most of the internal Jira clone function, which really does just copy everything.
To clone an issue with fields being dropped, you'll need to write your own script that can pull data from an existing issue and use bits of it to create a new issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure this is the case, not as I remember it anyway.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please help with the script for Jira cloud in postfunction or listener? The script in community more intended for Jira server.
I have two custom field which I want to exclude from being copied when cloned an issue in Jira cloud.
Thanks,
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a comment on a 5 year old question, so everything is out of date. Please ask a new question and describe your exact environment and what you want a script to do,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.