When we clone an issue we have to clear some custom fields for cloned issue in JIRA CLOUD
Asked by Velkuri Balaji:

Hello Team,

We have an ''Epic Type'' custom field which we don't want to be copied when cloned an issue, It has to show in original Issue but in cloned issue we don't want to see (need to be removed) We have Script Runner Plugin to implement this feature, but no idea how to configure the script.

Could someone help us to provide a script and where to implement the script.

Environment: **Jira cloud**   

Thanks in advance,

Balaji


Answers:
author: Luka Hummel - codefortynine
body: Hi [@Velkuri Balaji](/t5/user/viewprofilepage/user-id/5251557)

Like [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) already mentioned, there are also third-party apps on the marketplace that can help you with more complex clones.

With our app [Deep Clone for Jira](https://marketplace.atlassian.com/apps/1218652/deep-clone-for-jira?hosting=cloud&tab=overview&source=community331), you can use [Clone and Edit](https://c49.link/deep-clone-for-jira/docs/clone-and-edit) to clear your "Epic Type" custom field when cloning.


author: Trudy Claspill
body: Hello [@Velkuri Balaji](/t5/user/viewprofilepage/user-id/5251557)

What process are you using to clone the issue?

comments: author: Velkuri Balaji
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Thanks for your response,

We are just opening an issue and on left side corner we can click on the three dots and select the clone option then the issue will be cloned.


author: Trudy Claspill
body: That Clone feature doesn't provide options for setting or clearing fields in the new issue.

You could create an Automation Rule for cloning the issue that would allow you to clear the field. The rule could be use a Manual trigger so that users could use it instead of the Clone function under the More Actions button.

Or you could use an Automation Rule to clear the field after the clone process is completed.

Or you could look at third party apps that provide more customizable cloning options.

[https://marketplace.atlassian.com/search?hosting=cloud\&product=jira\&query=clone](https://marketplace.atlassian.com/search?hosting=cloud&product=jira&query=clone)


author: Velkuri Balaji
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011)

Thanks for your time and support,

Could you please provide steps how we can implement this by setting up automation rule, I have reached up to as attached below. May how I can remove the fields here, If we want to select only required fields it has more fields. Is there any way I can remove fields

However, I just want to add one more point that when we clone the issue and change the issue type on cloned issue then only we have to remove the fields, if the issue type is same as original issue type then we no need to remove those fields and we can achive this by using Script Runner - Listeners.

If it's possible could please provide script and steps.

Thank you,

Balaji

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/268396i4BD208F11049FB5C/image-size/large?v=v2&px=999 "image.png")


author: Trudy Claspill
body: Click on the button that says **Choose fields to set**.

Select the field you want to clear.

Leave the value entry field blank. That should cause the field to be cleared in the newly created issue.

You can select other fields to set/clear.

You may find that some fields are not automatically copied over. You can also select fields here and copy the values into them from the trigger issue.


Tags: adaptavist

jira-cloud

post-function

script-listener

scriptrunner