I have two projects - Proj1 and Proj2 and one issue type IT1 for both the projects. I have requirement like if IT1 is created from Proj1, then there would be another cloned issue type under Proj2 and vice versa.
I have written two scriptrunner listeners for two projects to clone issue. I have written condition as below:
issue.issueType.name == 'IT1' &&
And in "Issue Link Type / Direction" , I have mentioned "causes" as the link type( where the name of the link type is "Problem/Incident" ).
But unfortunately while I'm trying to create the issue, it's entering into infinite loop. Can anyone please help me here?
Maybe just add an additional check, before creating a clone, to see it doesn't already have a "causes" issue link type?
Or populate a custom field, if it was created from a clone and check for that? You will need this only if the above option doesn't work for you.
I don't want to add another custom field for this until it is not possible to achieve with the normal way.
Regarding your first option, I already have written the condition as it is mentioned in the above question. But it's not working any how. So I want to know what's going wrong.
So, you have a listener for create events. And, within the listener, you:
1. Clone the issue in the other project
2. Create a link back to the original issue
Is that how it is done now?
If so, #1 will trigger the new "Issue Created" event and that might execute before #2 is done, right? Probably that explains why it gets in a loop?
I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...
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