Updating Fields when issue is cloned...

cmbecket June 14, 2018

When an issue is cloned, Jira copies everything about that issue to the new issue. In our case, we do not want to copy the Assignee, Due Date, and several other custom fields that are also dates. 

Using the workflow, I have set a post function to update the assignee when an issue is created, and this works also when its cloned, so that field is handled.

Remaining are the various date fields. I have created a rule in Automation that:

Trigger: Issue Created (set to run immediately)

Condition: If: Linked issues present Types: clones (have also tried "is cloned by"

Then: Edit issue fields - and I have selected all the issue fields I want to edit, which are all dates. I have left them BLANK because I want them to be "cleared".

 

Nothing seems to be happening. I have tried several things like removing my workflow assignee update and an action to update the assignee to "unassigned" and that also did not seem to work. It just cloned the assignee. So I thought maybe automation was not running at all and made a test where upon creation of ticket, it would apply a comment. This did fire off and thus I know automation is working.  

I am guessing my problem lies in either the Trigger or Condition. Maybe I am also doing something wrong with how I am clearing the date fields, which is to select them as fields to edit and leaving them blank.

 

Any ideas? :)

 

automation-1.pngautomation-2.png

2 answers

0 votes
Rob Crowell May 4, 2020

This is the current documentation link

0 votes
John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 14, 2018

Hi Chel,

thanks for your message. This all seems correct from initial inspection. 

Can I ask that you send through your audit log so I can see how the rule is firing?

Cheers,

John 

cmbecket June 15, 2018

Sure thing, thanks for responding!

So to produce this issue, I went to an existing issue, selected MORE and selected CLONE. It then created CR-346. Here is the audit log from that action:

cloned-ticket-audit-log.png

 

 

So on that ticket, when its cloned, its auto linked to the one it clones from, and so the "clones" descriptor is on the link on the ticket CR-346 - which I thought was the "Condition" I made in which to clear the fields. However, the field "Requested Due Date" is still populated as it was on the cloned ticket.

 

clone-ticket-clones.png

John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 17, 2018

Thanks for that Chel. Ok I think I know what the problem might be here. 

When Jira clones an issue, it doesn't add the link until after the issue is created. So, Automation for Jira has no reliable way to know when an issue is cloned. 

The potential way around this is to add a 're-fetch issue data' action after the clone. You have the ability to delay this action for a second, which will hopefully give Jira a chance to add that link. 

The above workaround is based on the assumption / hope that you are a server user. This unfortunately, isn't available in cloud. 

Let me know if that works. 

Cheers,

John 

Like Max Haley likes this
cmbecket June 18, 2018

That did indeed work! Thank you so much!!! Love this add-on by the way :)

John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 18, 2018

Excellent, glad to hear! And thanks for the compliments :) 

SKon February 18, 2019

John, can you please provide more details on -re-fetch issue data'

John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
February 18, 2019

Hey Srilatha,

no problem. Our docs explain it in nice colourful detail here: 

https://docs.automationforjira.com/getting-started/actions.html#re-fetch-issue-data

Cheers,

John

Pauline Monroy August 3, 2019

Hello, @John McKiernan1 ,

 Are there any similar workarounds for Cloud? 
How do I set a trigger to identify when a clone issue has been created and alert that a clone has been made?

Any help would be appreciated. 
Thank you! 

John McKiernan
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 4, 2019

Hey Kirti,

unfortunately, it is not so easy in Cloud. While there is still a re-fetch issue data action, it will only delay the issue by a millisecond which will not be enough time to detect that clone being created. 

However, there is a workaround (as long as you have set up your instance so that a link is created whenever an issue is cloned). 

You could use an 'issue linked' trigger and set the link type to 'cloners'. This means we will 'listen' for any cloned issues from Jira. (You could refine the search with any conditions you want) and then set an action.

I hope that helps!

Cheers,

John 

Screenshot at Aug 05 10-53-05.png

Pauline Monroy August 4, 2019

Thank you, @John McKiernan1 ! 
I did try out the "Issue Linked" trigger. Didn't seem to work for me. I tried the following which currently serves my purpose for now. 

- To alert when a clone has been made into the Jira Project whenever a Request has been placed in the Service Desk -

When: Issue Created

Then: Re-fetch issue data

If: Proj = Service Desk 

AND Linked issues match Proj: Jira Proj

Branch: For Linked Issues: (Cloners)

Then: Send Slack message "The URL to the Jira issue is: {{issue.toUrl}}

 

SS: http://prntscr.com/ooe8r3

Like John McKiernan likes this
NAVEENKUMAR CH February 28, 2024

Hi Jhon

can you please give the details of full automation rule

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events