Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I filter a trigger based on cloned issue?

Dennis Lindqvist August 16, 2023

I'm trying to setup a rule that triggers if a new Epic issue has been cloned from a certain issue (ISSUE-1).

I've tried using

 

When: Issue Created

If: Some Linked issues match
  Types: clones Match: {{issue.key.equals("ISSUE-1")}}

Then: Add comment to issue
  The rule worked

 

But I didn't expect to provide a JQL Query since Linked Issues only contains issue keys.

1 answer

1 vote
Stefan Salzl
Community Champion
August 16, 2023

Hi @Dennis Lindqvist 

my conditions in Automation 4 Jira say "Linked issues" with the option "some match JQL". Therefore I tested this with JQL in my instance and it worked.

The point is that a JQL doesn´t only provide issue keys but a list of resulted issues. Furthermore it´s about the jql itself not the result. You could write a JQL that doesn´t take the issuekey into account but eg. filters for any field (eg. you could ask if any of the linked issues´ summary contains of "test"). 

image.png

Best
Stefan

Dennis Lindqvist August 16, 2023

I changed my rule to

When: Issue Created

If: Some Linked issues match
  Types: clones Match: issuekey = ISSUE-1

Then: Add value to the audit log
  Test: Successful

My audit log now says I'm comparing against the newly created issue instead of any linked issues :/

NO ACTIONS PERFORMED
Related issues condition
The following issues did not match the condition:

ISSUE-2

Stefan Salzl
Community Champion
August 16, 2023

So you were in ISSUE-1 and clicked „clone“ and the issue was cloned to ISSUE-2? is that correct?

Could you please share a screenshot of your rule and your audit log?

Best
Stefan

Dennis Lindqvist August 16, 2023

Yes. And if the clone was derived from a specific source, then some magic stuff should happen with the clone :)

rules.pngaudit.png

Stefan Salzl
Community Champion
August 16, 2023

Do you clone the issue within the same project? When you open the clone (newly created issue): is the link set in the issue?

Best
Stefan

Dennis Lindqvist August 16, 2023

Yes on both questions. 

Stefan Salzl
Community Champion
August 16, 2023

could you also send a screenshot of the cloned isseu (the one that triggered the rule): Issue -1437 ?

Dennis Lindqvist August 17, 2023

I've already removed 1437. Here is 1438 instead :)

Clone.png

Dennis Lindqvist August 17, 2023

Apperantly, issuekey is for the newly created issue (duh), and I need to use the smart property {{destinationissue}} (there is no ordinary property available for linked issue that I could find).

See, https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Jiraautomationactions-Cloneissue

So I tried working with Issue linked as a trigger instead...
https://confluence.atlassian.com/automationkb/how-does-jira-automation-issue-linked-trigger-pick-the-source-and-destination-issue-1115133704.html

But I can't activate 'Execute this rule immediately'

Linked.png

Stefan Salzl
Community Champion
August 17, 2023

Does the rule do the work? Why would this option be necessary? 

Dennis Lindqvist August 22, 2023

Since I can't filter based on a specific link, I can't create a working rule.

When I clone an Epic, the tasks within isn't cloned as well.

I need a way to determine all tasks belonging to a certain origin Epic and then have them cloned and attached to the newly cloned Epic.

Stefan Salzl
Community Champion
August 22, 2023

Ok. I got pretty confused on this topic.

The original post is about "how to find out if a cloned issue is a clone of a specific other issue". So this requirement has never been mentioned in the context.

 

When I clone an Epic, the tasks within isn't cloned as well.

That´s right - deep and bulk cloning isn´t possible out of the box with jira native possibilities.

 

Gimme some time so I could think of any solution that might work.

Best
Stefan

Like Dennis Lindqvist likes this
Stefan Salzl
Community Champion
August 22, 2023

Hi @Dennis Lindqvist 

So this would be my way of solving it (as far as I got your requirement right now):

This will check for any issues under the original Epic via JQL and then does a "clone issue" for each of the resulting issues also setting the Epic Link to the newly/previously create/cloned epic.

I didn´t do the check if a specific epic was cloned but I guess that was working already on your side. So keep in mind to keep your condition for this.

image.png

Hope this helps.

Best
Stefan

Like Dennis Lindqvist likes this
Dennis Lindqvist August 22, 2023

Excellent help, thanks.

Only issue is; this till will clone all tasks of *any* Epic cloned. I'd only like it to trigger for specific Epics.

Stefan Salzl
Community Champion
August 22, 2023

did you try the rule? if so: could you please share screenshots of your rule and the audit log?

As I created the rule it only clones the tasks of the destinationIssue epic (as it is configured in the JQL). This was also tested in my instance and just cloned the tasks of this specific epic the other epic was cloned from.

Best
stefan

Dennis Lindqvist August 22, 2023

Yes, the rule works as set up.
Any cloned Epic will have all it's tasks cloned as well.

But...

For my need, only *certain* Epics of my choosing should have their tasks cloned if the Epic is cloned...

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.6.0
TAGS
AUG Leaders

Atlassian Community Events