How to remove linked issue after moving the issue into Done
Asked by ????? ?????:

Hello,

I want to make the following automation rule:

1. We have issue which blocks another one, so it has blocked linked issue.

2. when this user story has "Done" status:

2.1. Blocked issue converted into relates to

2.2. Blocked issue removed from the card.

I made this rule, but blocked issue is not removed

![Screenshot 2024-06-18 at 12.12.28.png](/t5/image/serverpage/image-id/330331iFD9E1C9E93FA5108/image-size/large?v=v2&px=999 "Screenshot 2024-06-18 at 12.12.28.png")

![Screenshot 2024-06-18 at 12.22.29.png](https://community.atlassian.com/t5/image/serverpage/image-id/330335i5551160929662879/image-size/large?v=v2&px=999 "Screenshot 2024-06-18 at 12.22.29.png")

![Screenshot 2024-06-18 at 12.23.20.png](https://community.atlassian.com/t5/image/serverpage/image-id/330336iFCE7CFE0795B5CDF/image-size/large?v=v2&px=999 "Screenshot 2024-06-18 at 12.23.20.png")![Screenshot 2024-06-18 at 12.23.29.png](https://community.atlassian.com/t5/image/serverpage/image-id/330337i65BC22D8BE6257D8/image-size/large?v=v2&px=999 "Screenshot 2024-06-18 at 12.23.29.png")


Answers:
author: Bill Sheboy
body: Hi [@????? ?????](/t5/user/viewprofilepage/user-id/5150846)

Your rule is making two edits to the same issue and so it is likely the updates are colliding.

I recommend these changes to your rule:

* Perform the Delete Link action first
* After that, add a Re-fetch Issue action to reload the issue data
* Replace the Issue Edit action with the Link Issues action to add the "relates to" link

Kind regards,  
Bill

comments: author: ????? ?????
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) , thanks for the reply.

But Blocks and Blocked by are not deleted after moving the story to Done

![Screenshot 2024-06-19 at 12.26.54.png](https://community.atlassian.com/t5/image/serverpage/image-id/330572i3FAF78544E1F4222/image-size/large?v=v2&px=999 "Screenshot 2024-06-19 at 12.26.54.png")

![Screenshot 2024-06-19 at 12.28.15.png](https://community.atlassian.com/t5/image/serverpage/image-id/330573iF8F3201488FD7221/image-size/large?v=v2&px=999 "Screenshot 2024-06-19 at 12.28.15.png")

![Screenshot 2024-06-19 at 12.30.28.png](https://community.atlassian.com/t5/image/serverpage/image-id/330574i9608F96A7B002D2E/image-size/large?v=v2&px=999 "Screenshot 2024-06-19 at 12.30.28.png")


author: Bill Sheboy
body: Please note...

1. when the branch runs, it is looking for linked issues from the *trigger issue's perspective* of "blocks"
2. when the Delete Issue Link runs inside the branch, it is looking for links from the *linked-to issue's perspective* for "blocks"

I believe the second one is incorrect. This type of link is *directional*, and so the Delete Issue Link should instead try deleting "is blocked by".

Also please note: the Delete Issue Link action will *delete all links of that type* from the issue, regardless of to which issue they are linked. It will not only delete the link to the trigger issue.

And so if you have more links, the rule will need to be more discerning: rather than using the Delete Issue Link, it would use the Send Web Request action to call the REST API endpoint to delete the specific link, using its link id value.


author: ????? ?????
body: xx


author: Dave Mathijs
body: Hi [@????? ?????](/t5/user/viewprofilepage/user-id/5150846) What does the audit log say when this rule is triggered?

comments: author: ????? ?????
body: ![Screenshot 2024-06-18 at 15.12.49.png](https://community.atlassian.com/t5/image/serverpage/image-id/330405i4F8F33052317D402/image-size/large?v=v2&px=999 "Screenshot 2024-06-18 at 15.12.49.png")

I see only this


author: Dave Mathijs
body: Looking at the audit log, the automation rule was executed successfully.

So, KN-2 blocks KN-1, correct? Is KN-2 still linked to KN-1 after KN-1 was transitioned to status 'Done'?


author: ????? ?????
body: KN-2 blocked by KN-1, and I moved KN-1 to Done


Tags: cloud

jira-cloud

linked-issue