Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

We need to restrict linking in edit screen from source to destination in JIra cloud

thumuluru_shreya
Contributor
June 15, 2025

Assume that we have 2 issue types A and B

A issue will link to more than one B issues ( 1 to many)

B issues will link to only one A issue (many to 1)

 

and the link between A and B is "is fixed by" and the link between B to A is "fixes".

How we can restrict the linking in edit screen such that A issue will link to more than one B issues and B issues will only link to one A issue. Could you please help me in this solution it will be helpful.

 

Thanks

2 answers

2 votes
Brita Moorus
Contributor
June 15, 2025

Hi @thumuluru_shreya! ☀️

This kind of relationship (1 → many and many → 1) isn’t enforced out-of-the-box in Jira Cloud, but you can replicate the behaviour it by restricting linking behavior using automation rules:

  • Create a rule that triggers on issue link creation
  • If a B issue is already linked to an A issue, prevent further linking (f.e. unlink it immediately or add a comment warning the user)

Automation can't block linking on the edit screen, but it can reverse or flag unwanted links.

You can also look into ScriptRunner (Marketplace app) to add more control:

  • Enforce only one A-type link per B issue
  • Validate link direction

If you're open to custom development, Forge apps can be used to hide or restrict the link field entirely based on conditions.

There’s no direct way to enforce this at the UI level in Jira Cloud, but these workarounds can help 😊

thumuluru_shreya
Contributor
June 15, 2025

Hi @Brita Moorus , Could you please help me in script runner or automation on how to approach this. Because we are using these apps in our project. It will be helpful 

 

Thanks

Like Brita Moorus likes this
thumuluru_shreya
Contributor
June 15, 2025

Hi @Brita Moorus , For me this requirement is very crucial to achieve. Could you please help me in this to solve this one.

 

Thanks

0 votes
Brita Moorus
Contributor
June 21, 2025

Hi, @thumuluru_shreya! 😊

Thanks again for your question - I tested this out using Automation Rules, and here’s what I found:

Unfortunately, Jira Automation doesn’t allow us to remove just the most recently added link - it can only remove all links of a given type, which isn’t ideal in this case. 😕

Untitled whiteboard 2025-06-21.png

However, a good workaround is to inform the user with a comment when an invalid link is added.

Here’s how the rule can be set up:

🔹 Trigger: When an issue is linked, and the link type is "Fixes"

🔹 Condition: The number of issues linked via "Fixes" is greater than 1

🔹 Action: Add a comment to the issue, like this:

⚠️ This issue is already linked to another issue using the "fixes" relationship.

Only one "fixes" link is allowed per B-type issue. The newly added link to {{destinationIssue.key}} from {{triggerIssue.key}} is not valid.

👉 Please review and remove any duplicate links.

🛠️ If needed, you can make the rule even more precise by adding conditions to validate the issue types involved - for example, checking that the issue being linked from is type A and the one to is type B. This helps avoid false positives and ensures the rule only triggers in the right situations.

I hope this helps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events