Clearing custom fields while cloning a ticket

Jignesh Jaiswal October 3, 2023

How to clear fields value when an issue is cloned? Automation rule and workflow rule does not seem to work while Clone feature is used.

3 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 3, 2023

Hi @Jignesh Jaiswal 

When you use the Clone Issue action in an automation rule, you have the option to override the value of any fields.

So if you do not want a field to copy from the source issue, just select that field in the action and clear the value.  If the field is not shown in the drop-down list, you may use the advanced edit with JSON feature to clear the field.

Kind regards,
Bill

Jignesh Jaiswal October 3, 2023

hi @Bill Sheboy I tried, that, but its not clearing the fields too. I have this rule created against "Issue Created" but it seems the Clone is being treated differently than Created. Any workaround would be appreciated. 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 3, 2023

Please post images of your complete automation rule, including the details of your Clone Issue action, and of the audit log details showing the rule execution.  Those may provide context for what you are describing.

Jignesh Jaiswal October 3, 2023

 

hi @Bill Sheboy here it isjiraduedate.png

Jignesh Jaiswal October 4, 2023

my rule worked if i remove the comparision of "if condition that checks if the Due date is not empty".  

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2023

Is the rule working as you expect now?

What was the purpose of your condition testing the Due Date?

 

And...please note the Issue Created trigger can happen so quickly that the data is not yet available to the rule.  This can cause conditions and actions to work unexpectedly later in the rule.  For example, some of your cloned fields may remain empty

One work-around for that is to always add a Re-fetch Issue action immediately after the Issue Created trigger.  This will slow down the rule by about a second and reload the trigger issue's data before proceeding.

Jignesh Jaiswal October 4, 2023

yes, the rule is working as expected. I am not sure though why having a condition of "Due date is not empty" would fail it. However, we could survive with always clearing the "Due date" I removed the condition. 

I feel, as the rule triggers when issue is created, it is looking at the new issue which is cloned, while i am trying to fetch the data from source ticket data, probably that may be the reason its failing? 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2023

Yes, that is correct...as I noted in my last two paragraphs above. 

What is happening is sometimes the data is not available after the Issue Created trigger, and so your condition test on Due Date is not empty was not passing.  That I why I noted adding the Re-fetch issue after the trigger.

Like Jignesh Jaiswal likes this
0 votes
Luka Hummel - codefortynine
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 4, 2023

Hi @Jignesh Jaiswal

If you are willing to try a third-party app, our Deep Clone for Jira could help you.

With our Clone and Edit feature, you can edit or clear specific field values while cloning issues.

  1. Open the clone dialog
  2. Click Open Field Editor ✏️ under Edit fields
  3. Set fields that should be edited automatically in the clone

image.png

Jignesh Jaiswal October 5, 2023

hi @Luka Hummel - codefortynine Sorry we are only looking for existing Jira feature for now. Our usage is limited so don't yet want to use any third party.

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 3, 2023

You don't.  There's no mechanism for this because cloning means cloning - it is supposed to create a copy of the source issue that is as close to the original as possible, and that means copying all the fields.

Jignesh Jaiswal October 3, 2023

hi @Nic Brough -Adaptavist- Thanks for the reply. is there any way to stop cloning for a project?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2023

No, it's a function of "create issue" - if someone can create an issue in a project, then they can use clone.

Jignesh Jaiswal October 11, 2023

This got fixed, as soon as i removed the "if condition that checks if the field was empty".

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events