I'm trying to work out how to refine the existing (built in) cloning function for a particular issue type to effectively restrict some fields from being populated to the newly cloned record.
Example - cloning a change request include all fields apart from planned start and end date.
I guess my main challenge here is trying to find the appropriate method of restricting the automation trigger to only apply when issue is created via 'clone' rather than manual creation of new issue. From here I can apply the logic but I can't seem to figure out how to define this particular trigger scenario.
Feels like it will be very obvious but any help would be appreciated.
Thank you
Hi @Gary Pallas, welcome to Atlassian Community.
When you clone an issue it will allways create an issue link to the source issue, hence you shold be able to use an automation rule with a Created trigger, and then add a filter looking for the Clones link type.
This will not work using an Edited trigger since the link might have been removed by a user. But when the issue is created the link exists, and can be used as a filter for further processing in the automation rule.
Below the filter within you rule you can then set or remove values from all wanted fields.
TimK
Hi Tim
This sounds promising and exactly the sort of association I was looking for to 'hook into' as the trigger for any honing of clone rules - thanks Tim - I'll give this a go. Appreciate the insight
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Struggling a little. It would seem that the clones link type doesn't exist.
To check this further I've tried to use this as a basis in a filter (including 'issueLinkType = clones' into the query) and nothing returns despite there being cloned issues within the wider parameters.
Is this the correct linkage I am looking for?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Gary PallasTry using the Refetch action to make sure the link actually exists after the Issue Created event.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Gary Pallas, I created a test rule looking like this:
After I cloned a test issue, the audit log shows this::
Have you tried a setup like the example above?
The correct JQL for finding this manually is
issue in linkedIssues(MOBL-57, Clones)
So, using this in an automation by JQL should be
issue in linkedIssues({{issue}}, Clones)
See JQL functions | Jira Cloud | Atlassian Support for detals on syntax. Also notice linedIssue vs linkedIssues(). Use the latter in your scenario since the first doesn't utilize the linke type.
But you don't need JQL in the rule as shown in the example rule above.
TimK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks again Tim - yes I tried exactly that rule from your screenshot above and I don't appear to have an option for 'clones' within Link Types drop down. Was this a relationship type that was configured as a pre-cursor? Or was this out of the box? I can look to the JQL as another idea so again thanks for sharing that - appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are a few additional options here but clones is not one of them
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gary Pallas , I suspect the Cloners link type has been renamed or removed from the Issue linking settings.
Please have a look at this KB article Cloned ticket is not linked to the Parent | Jira | Atlassian Documentation
Are you able to try "restoring" the Cloners link type as described in the article?
TimK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gary Pallas where you able to in the end solve this, based on the replies provided within this thread? If so it might be helpfull for other users, searching for the same problem, if you mark the answer as accepted.
TimK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gary Pallas
If you are having trouble achieving your goal with Jira Automations, you could try our app Deep Clone for Jira. Deep Clone allows you to clone issues and make changes to the data that is being cloned. You can use the Field Editor feature to edit field values or clear them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you're doing cloning action try to set planned start and end to empty value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Tomasz - yes this is exactly my thought process for this field - it was the trigger for identifying new issues created by 'cloning' that I was most struggling with. Appreciate your help
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.