Inheritance labels IF I clone the test case with labels
Asked by alexei:

Our team has test cases with labels. When we clone a test case with labels, they are inherited. Is it possible to remove the inheritance of the labels field?


Answers:
author: Luka Hummel - codefortynine
body: Hi [@alexei](/t5/user/viewprofilepage/user-id/5578773) and welcome to the community!

When cloning a test case in Jira, the labels are inherited by default, which can be inconvenient if you need different labels for the cloned issue. To customize this behavior, I recommend using our app [Deep Clone for Jira](https://marketplace.atlassian.com/apps/1218652?utm_source=atlassian&utm_medium=referral&utm_campaign=deepj-new-reach-com-2797022). Deep Clone allows you to specify exactly what fields to include or exclude during the cloning process, including labels. For labels, you can use our [Field Editor](https://documentation.codefortynine.com/deep-clone-for-jira/field-editor?utm_source=atlassian&utm_medium=referral&utm_campaign=deepj-new-reach-com-2797022) feature to clear the field while cloning.

![2024-08-30 14-14.png](https://community.atlassian.com/t5/image/serverpage/image-id/344777i4E8A724BB14825BA/image-size/large?v=v2&px=999 "2024-08-30 14-14.png")


author: Pears Whims
body: Hi Alexei,

When cloning a test case in Jira, labels are inherited by default. If you want to remove the inheritance of the labels field, here are few solutions that may be working, depending on Your setup, environment and apps available.

**Automation Rule with Autiomation for Jira**

* Set up an Automation Rule to clear labels when an issue is cloned. This may work for certain issue types:
* Trigger: Issue Created.
* Condition: Something that can determine issue was cloned. Issue type or CLONE prefix.
  * Advanced Compare Condition: Use this condition to check if the summary contains the word "CLONE".
    * Configuration: Field: {{issue.summary}}
    * Condition: contains
    * Value: CLONE
* Action: Edit Issue to clear the Labels field.

**Scriptrunner Custom Scripting**

If you use Scriptrunner, you can write a custom script to automatically remove labels when cloning.

I hope this may help.

Best regards,  
Pears


author: Valerie Knapp
body: Hi [@alexei](/t5/user/viewprofilepage/user-id/5578773) , welcome to the Atlassian Community and thanks for your question.

I don't think it will be possible to choose what is and isn't copied using the standard cloning functionality - <https://support.atlassian.com/jira-software-cloud/docs/clone-an-issue/>

You can use scripts or apps to copy issues (or test cases) where you could specify exactly what you want to copy and not the rest. Is this a possibility for you? Do you have any apps like ScriptRunner or Jira Misc?

Cheers


author: Pears Whims
body: Hi [@alexei](/t5/user/viewprofilepage/user-id/5578773) ,

I wanted to check in and see if any of the suggestions helped you with the issue of label inheritance when cloning test cases. If you found a solution, it would be great to know, and feel free to accept any of the answers if they resolved your problem - it helps others find solutions faster.

Looking forward to hearing how it went!

Best regards,  
Pears


Tags: cloud

jira-cloud