How can we reset Labels field when a clone is done?

Yogesh Ranjitkar May 5, 2022

Hi all,

I want to reset/clear the Labels Field when an issue is clone. I have written the script runner that can do so for Custom fields but since Label is a Jira System field, I am not able to reset it on clone. Can any Jira experts help me with it?

 

Also, can we use Clear field Post function to do so on clone. The Label field is not on Create screen, so even if I can figure out how to use the clear field JSU post function, it will work for me.

Thanks in Advane

1 answer

0 votes
Suzanne Matheu May 5, 2022

Jira doesn't distinguish creating a new issue versus creating an issue via clone, so this can lead to challenges in scenarios where you only want the action to happen for one or the other.

In your case, you have two things working in your favor:

  • The Labels field is not on the Create screen
  • You have ScriptRunner

This combination means you have the option to clear the Labels field at creation without negatively impacting your users who are simply creating a new issue not using clone.

Here's how we do that:

  • Navigate to the Create > To Do (Open, Backlog, etc.) transition in the workflow
  • Add the Post Function: Clear fields(s) [Scriptrunner]
  • Select the field you want to clear from the dropdown (in your case, Labels)

The one thing to keep in mind is that given this solution impacts new issues regardless of how they are created (create or clone), should you ever change your screen configuration to include Labels on the Create screen, it would cause a negative user experience.  The end user would input a value in the field, as the issue is being created the post-function would clear the value they entered and once the issue was created the field would appear blank on the issue detail screen.  It's very frustrating for the user as they know they just entered the data.

As long as you aren't planning to add Labels to the create field though this should give you the result you want.

Suggest an answer

Log in or Sign up to answer