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' &&
!issueLinkManager.getInwardLinks(issue.getId())*.issueLinkType.name.contains('Problem/Incident')
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops, missed that condition. When are you creating the issue link? Is it after the issue is created? If so, the create listener is probably triggered already and the issue wouldn't have a link at that time?
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.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.