Automation rule for two issues that are linked via another issue
Asked by Konrad:

I have two projects A and B. Issue A1 is linked to two issues B1 and B2. Is it possible to design automation rule via branching or otherwise, so when B1 transitions to 'Accepted' status the issue B2 transitions automatically to 'Rejected' status. I imagine that there is a link between B1 an B2 via A1 issue, but perhaps I am mistaken?


Answers:
author: Shikha Verma
body: Hi [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976) you can achieve this by using a Unique Identifier.

* Create a custom field (e.g., "Unique Identifier") in Project B.
* When linking issues B1 and B2 to A1, ensure that each issue in Project B has a unique identifier in this custom field.  
  Then Modify the Automation Rule: Add a JQL condition like `project = B AND "Unique Identifier" = "Value1"` to target B1 and a separate condition for B2 with `"Unique Identifier" = "Value2"`.

comments: author: Marc - Devoteam
body: Hi [@Shikha Verma](/t5/user/viewprofilepage/user-id/4990585)

I know, but this needs to be provided, when will it be provided.

How is this in the process, this all needs to be defined by [@Konrad](/t5/user/viewprofilepage/user-id/5512913)

Otherwise the solution is general, I know we provide guidance, but he needs to identify a seperator.


author: Shikha Verma
body: Hi [@Konrad](/t5/user/viewprofilepage/user-id/5512913) You can try this:

1. **Trigger:** Issue transitioned (B1 to Accepted)
2. **Branch:** Branch on linked issues (Linked via A1)
   * **Condition:** Linked issue is in project B and is not B1
3. **Action:** Transition issue (B2) to "Rejected"

comments: author: Marc - Devoteam
body: Hi [@Shikha Verma](/t5/user/viewprofilepage/user-id/4990585)

Both issues B are in project B, then based on your suggestion, they would need to have an unique identifier, otherwise this rule will only work once.


author: Konrad
body: Hi [@Shikha Verma](/t5/user/viewprofilepage/user-id/4990585) ,

Can you elaborate on step 2 please. I tried the 'Linked Issues' (from 'type of related issues' field) however that only works on direct links, that is when B1 transitions the A1 will transition but not the B2.

Edit:

I tried **Condition,**JQL condition:

project = B AND issue in linkedIssuesOf("{{issue.key}}") AND status != "Rejected"

for instance


author: Shikha Verma
body: Hi [@Konrad](/t5/user/viewprofilepage/user-id/5512913) You can achieve this by JQL. Please try project = B AND issue in linkedIssuesOf("issueKey = {{triggerIssue.issueKey}}", "relates to")  
Hope this will help you!


author: Marc - Devoteam
body: HI [@Konrad](/t5/user/viewprofilepage/user-id/5512913)

Also think about, what will happen if users add more links to issues A1.

They will be impacted as well if the same link type will be used.


author: Shikha Verma
body: Thank You, [@Konrad,](#) for accepting the answers. It will help others!

comments: author: Bill Sheboy
body: Hi [@Shikha Verma](/t5/user/viewprofilepage/user-id/4990585)

When posting to community questions, **please stay within the same thread** rather than creating new ones for each response.

That will help others reading this question in the future know if there are multiple possible solution approaches to choose from.

Kind regards,  
Bill


author: Marc - Devoteam
body: Hi [@Konrad](/t5/user/viewprofilepage/user-id/5512913)

No there is no link between B1 and B2 if its not set.

The issues are both only linked to A1.

Automation could handle this, but you would need to have a link to B1 and B2

comments: author: Konrad
body: Hi Marc,

Thank you for the tip, however, the only link I would like to have is the one through A1.

Cheers


Tags: cloud

jira-cloud