I am using a webhook as my trigger which comes from our HR management platform when a monitored field on that platform is changed for an employee.
E.g if an employee's location is changed, it triggers a POST to the webhook which creates a ticket in Jira. The problem is that multiple fields are monitored, and if the same employee undergoes multiple field changes, then multiple tickets are made.
I want to use a JQL to search for tickets using the employee ID as a webhook smart value so that instead of creating a new ticket each time, I first look for an existing ticket and add a comment to that.
This is all relatively simple, as I can use a JQL search with an Issue Lookup. The problem is that the HR platform will POST a JSON with multiple employees occasionally. This is because the shortest trigger time I can set is 60 seconds, and if multiple employees undergo a change within those 60 seconds they all get added to one JSON.
To combat this i use a FOR EACH loop on every employee ID in the JSON. However, after performing an issue lookup within this for each loop, I have no way to reference any of the resulting issues from the lookup so that I may add a comment (no way to add nested loops as of now).
Does anyone know how I can reference the resulting list of issues from an issue look up within a FOR EACH loop?
Note: I can't use the JQL search within the webhook trigger because I use the employee ID smart value from the FOR EACH loop within my query.
