Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Clone Issues , entering infinite loop Edited

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?

 

1 answer

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.

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?

the issue link is created within listener.

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?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Core

How to manage many similar workflows?

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 ...

3,888 views 11 5
Join discussion

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you