Jira (DC) Automation: How to delete a certain issue link immediately after it's creation?

Gisela Lassahn May 3, 2024

Hi all together,

I've got an automation rule triggered when an issue is linked, and I want the rule to delete exactly this new issue link when certain conditions are fullfilled (such as: wrong project, wrong type, wrong link direction).

Any ideas?

1 answer

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 3, 2024

Hi @Gisela Lassahn 

Please try using the Issue Linked trigger and testing these smart values with Issue Field and Advanced Compare conditions:

{{destinationIssue}}}

{{linkType}}

https://confluence.atlassian.com/automation/jira-automation-triggers-993924804.html#Jiraautomationtriggers-issuelinkedIssuelinked

Kind regards,
Bill

Gisela Lassahn May 13, 2024

Hi @Bill Sheboy ,

I know the smart values you mentioned and already use Advanced Compare conditions.
But there seems to be no way to find out the "direction" of the link (e.g. if A blocks B or the other way round).

And I couldn't find any way to delete exactly the (just created) wrong link within an automation rule, only an action to delete all links or all links of a certain link type and "direction".

So, in the meantime, I've tried to create another solution, which is to check either the links immediately when they are created or check them in a scheduled rule, and send an email, if the links do not fullfill my conditions, instead of trying to delete them.

See also: Are there Smart values to get the link direction i... (atlassian.com)

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 13, 2024

Thanks for that information.  As @Trudy Claspill described in that other thread, some links have directions while others do not.  The type of link and the triggering issue can be used to determine "direction" when it is relevant.

 

A possible workaround for deleting a single, specific link is to use the Send Web Request action to call a REST API function to delete the link with its link id value.

However, it may not be possible to get the just-added link's id when there are multiple links to the issues using an automation rule.  In my testing with Jira Cloud, the trigger did not appear to supply that one; perhaps you can find it with your version of Jira.

If there is one-and-only-one link of that type, I hypothesize the link id could be found by filtering on the type from the issuelinks smart value in the trigger issue.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 13, 2024

I have since added a suggestion to the other thread for checking the direction of the newly created link by looking at the Project values of the issues that get linked.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events