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.
Hi @Abdul Mohammad ,
Regarding this:
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).
You kinda can get this by doing the following:
So with that, you could first check employees (as you do now) and then create another loop inside of that for each issue which contains the ID for the current (looped) employee.
Hope this helps.
Cheers,
Tom
I haven't tried this but maybe you can load a variable and then use it in the branch, like:
HTH,
KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kristján Geir Mathiesen thanks for your suggestion. I have used this feature to reference each of the employee ID's within the automation.
Problem arises when I try to add a comment to an issue that includes the employee ID. I have no way to reference the issue specifically in the automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry to hear, @Abdul Mohammad I haven't looked deep into this. Was just hoping to prod you in the right direction :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.