I have pretty simple automation with the following logic:
When issue in project X is transitioned into certain status then this issue is cloned into the other project.
Here is how it looks like:
I have added an additional check for linked issues to ensure rule is not triggered when issue was already cloned once. This rule works fine when I create an issue in "Open" status and then transition it into "PROD investigation".
The problem appears when status 'PROD investigation' is chosen during the issue creation. In this case issues is cloned twice meaning that by some reason rule is triggered twice.
I've tried adding delay before "Then", tried setting 'from' statuses in the trigger and couple of other options and nothing seems to work.
Am I missing something? Thank you in advance.
With the help of @Bill Sheboy I've managed to make it work. You'd need two separate rules: for creation and for transition.
When an issue is created in a status other than the first in the workflow, it does that in two steps:
This can be observed in the issue history.
Do you have two rules, where one is triggered on Issue Created and another is on Issue Transitioned? If so, for this scenario you would not need the Issue Created rule.
If that is not the case, please post:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy , thank you for the reply.
I don't have two separate rules, by some reason trigger happens twice within this automation.
Here is an image of the audit log within the rule
It appears that, for some reason, the rule is being triggered not only on transition but also on creation, which shouldn’t be happening and I don't know how to avoid this from happening.
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 information and I just recreated the symptom. I found this open defect for the symptom: https://jira.atlassian.com/browse/AUTO-916
I hypothesize the root cause is in the updated REST API endpoint for issue create as it may be raising the event twice: once on create and once on transition. Worse still for your scenario, the cloning adds linking (which is another slow operation) and so passes the condition due to rule timing problems between the two rule triggerings.
The workaround in the defect is not helpful: disable the feature to allow transition on create.
Some other workarounds to try could be:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill, thanks a lot for your help. It makes total sense now. I will try mentioned workaround next week and post the update.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy ,
Unfortunately, it still doesn't work as expected and duplicates are created.
Looks like there is no workaround. Anyway, thank you for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, let's go "brute force" to solve this: two rules, one for create transitions, and one for non-create transitions.
1) Create a rule, triggered on Issue Created, and check the status with a condition. Then check existence and perform the clone.
2) To fix the rule triggered on Issue Transitioned, let's return to your original rule with these adjustments:
You may adjust that 1 minute to meet your needs / risk tolerance. (For example, if there is an Atlassian automation outage and all rules stop running, theoretically the problem could still happen when the rules try to "catch up" running later.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works!
I considered checking the time difference since creation but didn’t think I could just use two separate rules.
Had to add re-fetch step for the creation rule, otherwise it didn't work. Also, I've used seconds instead of minutes to cover case with a quick transaction.
I will make a separate post with screenshots so I can accept the answer, unfortunately can't do so with you comment above.
Thank you a ton for helping me, Bill!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
looking at this problem at the source. Why not restrict it to just the "open" status when creating the ticket?
regards
Laura
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Laura,
You are right, it can be done, but due to the nature of the workflow, tasks can be created in other statuses as well.
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.