JQL branch not working when using trigger "Issue deleted"
Asked by C?dric Cox:

Hi everyone,

I am dealing with a strange limitation of JIRA automation. Here is the simple rule:

![bug.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/115456i857EC420A322DA88/image-size/large?v=v2&px=999 "bug.PNG")

I try to reach the epic issue of a subtask by using a JQL branching. When using this on a "issue created" trigger, all works well. But when, in this case, I use it in a "issue deleted" trigger, here is what I get:

Error searching for related issues. This is most likely because the following issues don't have a related issue of the type you specified. Try narrowing your search to only include issues that contain links to related issues:

IPUFRA-220: "((key = IPUFRA-96) AND **(key != IPUFRA-220))** AND (project in (10034))" - An issue with key 'IPUFRA-220' does not exist for field 'key'.

The JQL is not working because of the clause (key != IPUFRA-220) which seems to be added automatically. But for this trigger, this will always results in this error! This clause is not necessary. Any workaround with this?


Answers:
author: Yvan Martin
body: Hi C?dric,

Developer from Automation here, currently there is a limitation with our JQL branch that continues to add that issue protection when that issue would have been deleted. This is generally necessary to prevent the current issue being processed twice, but in combination with an issue deleted trigger this check should no longer be called.  

I've raised a public improvement here to address this, but it's not currently in our roadmap so there's no ETA on a fix: <https://codebarrel.atlassian.net/browse/AUT-2067>  

Apologies for the inconvenience.

Cheers.

comments: author: C?dric Cox
body: Hello Yvan,

Thank you for the raised improvement. Currently I found a workaround by calling a Automation webhook where I performed the necessary actions.

C?dric


author: Alessandro Cnapich
body: I have a similar issue. Could you please provide some detail on the workaround you implemented?

Thank you

- Alessandro


author: C?dric Cox
body: Hi Alessandro,

You have to send un web post request like this:

![1.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/154625i3AF0909B7DEFDBB2/image-size/large?v=v2&px=999 "1.jpg")

Where the body is defined as

![15.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/154629i8B98C08C920D2BE0/image-size/large?v=v2&px=999 "15.jpg")

After that, you create another rule to catch the post request, like this:

![2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/154626i3473F45A65BDD9AB/image-size/large?v=v2&px=999 "2.jpg")

Where the webhook is defined as:

![3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/154627iB3EABA947D5EE8E4/image-size/large?v=v2&px=999 "3.jpg")

And then, you can do this:

![4.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/154628iA896BFC6AC698F88/image-size/large?v=v2&px=999 "4.jpg")

Hope this helps,

C?dric


author: Doods Perea
body: Hi Cedric - may I ask for the full Webhook URL? I am on Jira Cloud.

The only thing not working in my Automation Rule is that when a child ticket is moved, the source parent ticket's "Original Estimate" value is NOT updated.

Thanks in advance.

Doods


author: Alessandro Cnapich
body: Thank you!


Tags: jira-cloud