How to access the {{createdIssue}} in a for-each-loop to edit fields?

Manju April 27, 2023

Hi everybody,
I am trying to create a list of feedback issues (e.g. for HR, who needs feedback from all employees hired last month (lets say 5 people)). I run the Jira automation rule from a Feedback-Blueprint-Issue, which is used as base for the employee-feedback issues (summary field and description), to copy the content from. The approach looks as follows:

Run rule from Feedback-Blueprint-Issue (== triggerIssue):

  1. Create {{ListOfAssignees}}, which contains email-ids of all employees, who should receive the feedback-issue
  2. Loop through this list with a "For each" component
  3. For each email-id, create a new ticket and copy summaryfield and descriptionfield from the {{triggerIssue}} to the new created Issue
  4. now it gets tricky:
    From the newly created Issue I take the assignee and try to find out the DisplayName. This DisplayName I want to add to the summary-field of the newly created Issue to have a better overview in my Board ("Feedback by Jane Doe"). If I take the "Edit Issue" component the {{issue}} points to my {{triggerIssue}} not to my {{createdIssue}}, so I cannot edit my newly created Issue. I tried to add a new branch within my For-each branch to access the "Most recently created issue", but this is not allowed within the Jira Automation (pic5). Is there any way to perform this simple task of using the inherint information of the {{createdIssue.assignee.displayName}} to add it to the summaryfield of {{createdIssue.summary}} of my newly created Issue?

Screenshots for better understanding:

  1. pic1.PNGpic2.PNGpic3.PNGpic4.PNGpic5.PNG

1 answer

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2023

Hi @Manju 

Unfortunately branch within a branch is not possible. Even if you try to add another branch for the Newly Created Issues, JA can't recognize the newly created issues, since they were created on another branch.. bummer.

However, after trial an error I came up with a solution, which may cost you on performance. But we'll get to that! So this is my rule:

ruule001.png

The magic component is lookupIssues. This is where you should narrow down your search and try to have as less results as possible. 

ruule002.png

And then when you create your issue, you simply write the following to the summary:

ruule003.png

 

I've tested it and works like a charm!

Let me know if you got this!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events