Edit/Update a custom field when deleting issue links
Asked by Bharat Kumar Bondalapati:

Dear community,

I have rather strange or probably easy question.

Here is the case:  
I have a ticket (A) and there are issues linked to this ticket which I am not bothered about.

I now have a custom field in ticket (A).

My question here is when we unlink or remove all the linked tickets from ticket (A), how can we create an automation rule using ''Issue Link Deleted'' trigger to update/edit the custom field with "No Linked Issues".

I have tried going through the instructions where it clearly describes about the source and destination issues and we can use {{issue}} and {{destinationIssue}}.

Could anyone let me know the rule or if anyone has a resolution for this?


Answers:
author: John Funk
body: Hi Bharat,

Can you share the rule that you have so far?

I am thinking create the rule with an Issue Link Deleted trigger as you mentioned.

The follow that up immediately with a Condition to see if there are any Linked issues.

Then update the issue.

See the example below.

![Screenshot.png](https://community.atlassian.com/t5/image/serverpage/image-id/337626i15F000020D591060/image-size/large?v=v2&px=999 "Screenshot.png")

comments: author: Bharat Kumar Bondalapati
body: Hello [@John Funk](/t5/user/viewprofilepage/user-id/7148) ,

I do have similar rule running (screenshot attached).

Basically here, there are two types of linked issues  
1. Issue (A) *causes* issue (B)  
2. Issue (A) *caused by*issue (B).

So, if I link an issue where Issue(A) *causes* Issue(B), the rules works perfectly as expected and edits the custom field in Issue(A).

The issue is when I link an issue where Issue(A) is *caused by* Issue(B), rule says No Action Performed. If I tweak the automation, the rule runs successfully but it edits Issue(C) that is linked with Issue(B). I only want Issue(A) to be edited.

I am hereby attaching screenshots of the rule and the log.

![unlink1.png](https://community.atlassian.com/t5/image/serverpage/image-id/337647iFBFEA267851EE347/image-size/large?v=v2&px=999 "unlink1.png")

![unlink2.png](https://community.atlassian.com/t5/image/serverpage/image-id/337650i3D7B0E83861E8070/image-size/large?v=v2&px=999 "unlink2.png")

Here is the log: 8581 is the issue to be edited. (Rule Passed)

![unlink3.png](https://community.atlassian.com/t5/image/serverpage/image-id/337649iEF8CDF88BD2F42B4/image-size/large?v=v2&px=999 "unlink3.png")

Here is the log: 8581 is the issue to be detected but the rule went to 2345 which is not the case. (No Actions Performed)![unlink4.png](https://community.atlassian.com/t5/image/serverpage/image-id/337648i9314C120B577AB98/image-size/large?v=v2&px=999 "unlink4.png")

Here is the log: Strange thing is the rule passed but it went on to edit 1927 that is linked to 2345 which in turn is linked to 8581. So here, 8581 should be edited![unlink5.png](https://community.atlassian.com/t5/image/serverpage/image-id/337651i5F55426030A6DC3A/image-size/large?v=v2&px=999 "unlink5.png")


author: John Funk
body: Probably best to get Atlassian support involved at this point.

<https://support.atlassian.com/contact/#/>


author: Bharat Kumar Bondalapati
body: [@Joseph Chung Yin](/t5/user/viewprofilepage/user-id/396739) [@John Funk](/t5/user/viewprofilepage/user-id/7148)

I actually want to make sure the automation works on destination issue (SD-8581) when linked issues are deleted.

![unlink4.png](https://community.atlassian.com/t5/image/serverpage/image-id/337722iB0767C664CAD7DC5/image-size/large?v=v2&px=999 "unlink4.png")


author: Joseph Chung Yin
body: [@Bharat Kumar Bondalapati](/t5/user/viewprofilepage/user-id/5533481) -

I agreed with what [@John Funk](/t5/user/viewprofilepage/user-id/7148) suggested. I would just keep the rule simple without the branch "If" setup. Can you explain your reasoning of having the if branches setup if you just want to update (edit) the source issue?

Best, Joseph Chung Yin

comments: author: Bharat Kumar Bondalapati
body: [@Joseph Chung Yin](/t5/user/viewprofilepage/user-id/396739)

The following as suggested by [@John Funk](/t5/user/viewprofilepage/user-id/7148) works fine when Issue(A) is the source.

![Screenshot 2024-07-24 214544.png](https://community.atlassian.com/t5/image/serverpage/image-id/337694iAA8D6C1D00BA2D01/image-size/large?v=v2&px=999 "Screenshot 2024-07-24 214544.png")

In some case, the linked issues make Issue(B) as the source and this rule fails. I need to have a rule where Issue(A) irrespective of being a source or destination gets edited whenever linked issues are deleted.


Tags: cloud

jira-service-management

jira-service-management-cloud