Forums

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

Syncing issues between projects

BenWade
Contributor
March 22, 2024

Hi everyone,

I need your help with this task.

I have two projects: Project A and Project B. Users in Project B do not have access to Project A.

In Project B, business partners create tickets (stories). Then PMO analyzes these stories, and if it is clear what has been done, PMO clones these tickets into Project A and links them so users in Project B can at least see the status of the ticket. Only tickets that have been approved by PMO are cloned to Project A where devs can start working on them.

Now, I want to sync cloned tickets. The thing is just seeing the status of the ticket is not enough. I want to sync comments and attachments. Is this possible to achieve using Jira's own capabilities?

Please do not suggest paid apps from the marketplace! I have more than 10 users in my Jira instance, meaning the free tier, which is applicable up to 10 users, cannot be applied to my case.

 

Users in project B can see the status of a cloned ticket without needing to Access Project A but this alone is not sufficient.

image.png

#jiracloud

#jirapremium

#companymanaged

1 answer

1 accepted

3 votes
Answer accepted
Ste Wright
Community Champion
March 22, 2024

Hi @BenWade 

You should be able to do both using Automation

---

Comments:

You will need to ensure...

  • Users who can comment in Project A also have comment permissions in Project B

The rule will look something like this...

  • Trigger: Issue commented
  • Condition: Issue fields condition
    • Field = Project
    • Condition = equals
    • Value = Project A
  • Condition: Related issues condition
    • Related issues = Linked issues
    • Link types = <link type here>
    • Condition = Some match specified JQL
    • JQL - project = Project B
  • Branch: Related Issues
    • Type = Linked issues
    • Link Type = <link type here>
      • Branch-Action: Comment on issue
        • Contents...
          • {{triggerissue.comment.last.body}}

The smart value will provide the contents of the last comment added.

Finally, you want to modify Rule Details to make the actor the same between the trigger comment and the action:

  • Select Rule details near the Update button
  • Change Actor to "User who triggered the event"

---

Attachments:

Rule should look something like this...

  • Trigger: Field value changed
    • Field to monitor = Attachment
  • Condition: Issue fields condition
    • Field = Project
    • Condition = equals
    • Value = Project A
  • Condition: Related issues condition
    • Related issues = Linked issues
    • Link types = <link type here>
    • Condition = Some match specified JQL
    • JQL - project = Project B
  • Branch: Related Issues
    • Type = Linked issues
    • Link Type = <link type here>
      • Branch-Action: Edit Issue
        • Field = Attachment
          • Copy Attachment from Trigger issue

---

You could also copy Status across using Automation if you would like, so it's all visible from the one issue?

Let us know if these work!

Ste

 

BenWade
Contributor
March 22, 2024

Hi @Ste Wright 

Thank you for your detailed explanation. I guess I did a mistake somewhere in the rule. Maybe you can identify my error. Is it a bi-directional sync? Comment and attachment synchronization work in both directions or only from A(BI) to B(COMEX)?

image.png


image.png

image.png

 

image.png

image.png

Ste Wright
Community Champion
March 22, 2024

Hi @BenWade 

The rule is single direction at present, which is likely why the error appeared - i.e comments in A (BI) will copy to B (COMEX), but not the other way around - so COMEX-123 does not meet the conditional criteria.

---

You could possibly get this into one rule, using additional IF/ELSE statements - something like...

Rule Details:

  • Scope = Multiple Projects
    • Projects = A, B
    • Actor = User who triggered the event

Rule:

  • Trigger: Issue commented
  • Branch: Related Issues
    • Type = Linked issues
    • Link Type = is cloned by
      • Branch-Condition: Issue Fields Condition
        • Field = Project
        • Condition = equals
        • Value = Project A
      • Branch-Action: Comment on issue
        • Contents...
          • {{triggerissue.comment.last.body}}
  • Branch: Related Issues
    • Type = Linked issues
    • Link Type = clones
      • Branch-Condition: Issue Fields Condition
        • Field = Project
        • Condition = equals
        • Value = Project B
      • Branch-Action: Comment on issue
        • Contents...
          • {{triggerissue.comment.last.body}}

----

Notes

This rule should work for both BI and COMEX, and the two Branches ensure that the comment is copied in the right direction using the Branch and the Condition.

However, the issue here is that the user's in COMEX don't have access to BI - so the comment action might not work due to this.

You could try...

  • Providing the users in COMEX with the "add comments" permissions...
  • But not provide them "browse projects"...

...and see if this rule works? 

I also think this could create other issues though, for example...

  • Does commenting add the user to the watchers?
  • Do watchers receive email notifications (which could contain restricted content)?
  • ...etc

There is an alternative though, see below!

---

Alternative

You could have two rules instead of just one:

  1. The rule listed in my first answer
  2. A rule that copies the comments in the open Project (COMEX) back into the restricted one (BI), but lists the author's name in the comment's body

The rule might look like this...

  • Trigger: Issue commented
  • Condition: Issue fields condition
    • Field = Project
    • Condition = equals
    • Value = Project B
  • Condition: Related issues condition
    • Related issues = Linked issues
    • Link types = <link type here>
    • Condition = Some match specified JQL
    • JQL - project = Project A
  • Branch: Related Issues
    • Type = Linked issues
    • Link Type = <link type here>
      • Branch-Action: Comment on issue
        • Contents...
          • From: {{triggerissue.comment.last.author.displayName}}
          • {{triggerissue.comment.last.body}}

The new smart value will provide the author's display name (FirstName LastName).

Finally, you want to ensure Rule Details has the Actor set back to "Automation for Jira":

  • Select Rule details near the Update button
  • Change Actor to "User who triggered the event"

---

Let us know if this helps!

Note: You need to ensure that the right Project is under the right link type when trying this in your instance.

Ste

Like BenWade likes this
BenWade
Contributor
March 25, 2024

Stephen, thank you for your detailed response🙌👍

I will accept the asnwer and test the flow when I am in the office.

@Ste Wright 

Like Ste Wright likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events