Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Updating Fields when issue is cloned...

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

This is the current documentation link

0 votes
John McKiernan Marketplace Partner Jun 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 

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 Jun 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 

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

John McKiernan Marketplace Partner Jun 18, 2018

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

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

John McKiernan Marketplace Partner Feb 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

Hello, @John McKiernan ,

 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 Aug 04, 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

Thank you, @John McKiernan ! 
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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

684 views 7 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you