Hello,
I have a question that is probably simple, but I can not figure it out and would appreciate the help of the Atlassian community.
It is on a JSM project.
When a work item is created:
- browse if there are existing work item from same reporter (OK)
- go through all existing work item from this reporter (foreach branch) and check if a specific custom field is not empty (OK)
- copy the value of this custom field (from the work item of the foreach) to the work item that triggered the rule
The last part is where I struggle.
- I have tested with "Edit work item", but it edits the work item of the foreach branch.
- I have tested with "Set issue property" (but it the property is associated to the work item browsed in the foreach branch, not to the work item that triggered the automation).
It seems to me that it should be rather simple, and that I am missing something...
With many thanks!
Céline
Edited July 15th - Additional information
Scope: JSM Service project
Aim: use the latest value provided of a custom field (WordPress Username) by a reporter that already created work items (same reporter and same "Purchase code" custom field) to populate the custom field "WordPress Username" for the newly created ticket, when this latter has no "WordPress Username" provided.
Here is a summary of the options I have explored
- Option A : Using JQL in a foreach branch: it seems that I can not refer back to the work item that triggered the rule, once I am in the branch looping through other work item. My conclusion is that this was not possible.
- Option B: Using JQL in a foreach branch and create a variable that should hold the value of the custom field "WordPress Username" of the more recently created found work item, for which it has been provided. It seems that I can not access the variable outside the foreach branch. Why??
- New Option C: Using "Lookup items". This is what I will test next.
Why is Option B not working??
Automation Rule for Option B

Audit log for Option B
