I’m sure this isn’t difficult, but my searches didn’t find anything. Probably because I’m not searching for the right thing. Hell, you guys know me by now. I know just enough about this stuff to be dangerous! I’m writing a workflow that takes a string and splits up the words into variables, resulting in var1, var2, var3, etc. Although I don’t expect the string to be longer than 5 or 6 words, I can’t say for sure. I want to take those variables and check if they match against a list of predefined words. So basically using the IF node and contains, but value1 needs to cycle through the variables and value2 needs to be any of the list of words. Then, the workflow will move to an HTTP request if a match is found. Right now, I’m only interested in the first match. But eventually, I’d like it to cycle through each match and run the HTTP request for each match. I’m going to elaborate below on what I’m looking to do short-term and long-term.
Short-term
I’m pulling data from a webhook notification that will have a ticket subject line. Let’s pretend this subject line is “Quickbooks and my email are not working”. My current workflow would take that string and split it into words, so var1=“Quickbooks”, var2=“and”, var3=“my”, var4=“email”, var5=“are”, var6=“not”, var7=“working”. Then I want to see if any of these variables match my list of words. Let’s pretend those words are “QuickBooks”, “email”, “outlook”, “DNS”. For now, the first match will then be used to run an HTTP request to a Bookstack API, which is already in place, to find any pages with a tag with the matching word. In this example, that tag would be QuickBooks and we would then query https://domain.tld/api/search?query={type:page}+[quickbooks]&page=1&count=5. This would give us up to 5 pages that have the QuickBooks tag. We are then going to update the ticket with a private note with links to those pages (not done yet, but this will be easy) for the technician who is assigned the ticket to easily reference.
Long-term
Ultimately, I’d love to have this cycle through each variable and for each match, pull the pages from Bookstack and then combine all the resulting URLs into one list and update the ticket. Unfortunately, the Bookstack API only allows for searching for pages that match multiple tags (AND vs OR). So each match would require a separate API search. In the example above, there would be a match for both “QuickBooks” and “email”. I’m thinking once I have my “short-term” workflow done, I’ll post it here and work through the long-term requirements.