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? :)
Community moderators have prevented the ability to post new answers.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excellent, glad to hear! And thanks for the compliments :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
John, can you please provide more details on -re-fetch issue data'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jhon
can you please give the details of full automation rule
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.