cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Looping through a lookup table and taking different actions per result

tara1
Deputy Chef II
Deputy Chef II

Hello! I am looking for the best approach to this. I have an array of products. I loop through the array looking to product matches to those in my lookup table. As there are matches, I am creating Jira Issues of different types and in different projects. This seems like a use case for custom coding or a custom action. Doing this inline for 6-7 potential matches is a bit unwieldy.


I am hoping to get some opinions. Thanks in advance if you have some thoughts!


UPDATE: I am posting what I did for the next person who may wander by.

I added the Jira Project Key and the Issue Type Name to the Lookup Table for each SKU. Then, when I created the Jira Issues, I used the Data pills from the list to populate the Project/Issue Type field to make that dynamic:



Then, I selected a Task Type from the drop-down list so that the custom fields that are in that project will be available for mapping:



It is working beautifully. A repeatable action (for each loop) is checking a dataset against the lookup table and creating the correct type of Jira issue for each match.

8 REPLIES 8

robert-klohr
Deputy Chef I
Deputy Chef I

I built a similar, though not identical, solution also based on creating Jira issues based on input from another system. The way I built it closes matches what Joseph Blanchett mentioned in a previous post.


1. Import product data used to created issues in various Jira projects.

2. Query Jira to get a list of all the relevant projects.

3. Loop through the products from step one with a nested loop for the Jira projects from step 2. The comparision is done inside the second, inner, loop.

4. We have a default project to use when there is no match made in the comparision logic.


Using this logic flow my list of products and projects can change and grow without any edits to my receipe. If we find that too many products are mathcing to the default project that is an indicator there is enough of a change, to either the product descriptions or the Jira project descriptions, to update the comparision logic inside the inner loop, or we have a misconfigured product/project.


We monitor the default project comparision in Jira but you could also build that along with a notification in the receipe if needed.

Interesting - I will think on this. The incoming data set differs with each run of the recipe, but I like the concept of building in methods to lower the need to manually update when the disparate systems themselves change.

tara1
Deputy Chef II
Deputy Chef II

David MacIntosh I will explore that, too - thank you!

jeff-allen
Deputy Chef I
Deputy Chef I

Hi Tara,


Workato actually has a convenient function that can be leveraged with Lookup Tables. This has helped me avoid some ForEach loops and simplify my Recipes. Docs page is here .Lookup tables | Workato Docs Let me know if you have any questions about using it.


Thank you,

Jeff