Looking for a brainstorm here and a possible solution on logic.
We have customer who gets an onsite visit “every other Thursday”.
We can use the scheduled tasks to build an every Thursday, but cron doesn’t support an every other option. There are some linux functions to determine if its an odd week or an even week, do you can kinda use that (at least until you get week 53 followed by week 1).
So I can only schedule it to run every Thursday, how might I accomplish the tracking of every other? Anything I can do with an “if” function or some math division?
My initial thought is this, using a method to create a flag:
-Create an asset for the company (or maybe a contact). Doesn’t really matter as long as it has a way to a) look it up and b) has a value that I can change (like a UDF).
-Then in the logic of the scheduled task, I would look for that value, if it’s present, don’t actually create the ticket, but clear the value. Then on other weeks if the value isn’t present, create the ticket and set the value.
I think I can probably create a UDF on the Company, such as “UDF: Visit Required” and then turn that on/off.
Hi @DBachen ,
This is a great question. Thank you for asking it here.
I would create the scheduled task to run every Thursday and then stop the task if it is running on the wrong Thursday. To stop the task, I would use two action steps.
The first action step will render the current week number of the year. For example, the first week of the year would render 1, the second week would render 2, and so on. Once you render the current week number, the second action step will stop the scheduled task if the week number ends in an even (or an odd) number. For example, you can kill the running task if the week number ends in 0, 2, 4, 6, or 8.
Here are what the steps look like:
- Step 1: Render the current week number with this text expression and store it as
custom.week
: {{date to_format="W"}}
- Step 2: Stop processing the rule set if it is an even number with this expression.
Let us know how that works!
That’s a good solution. I like how you use the ending value of the week to determine the even weeks. That would only break on a year with 53 weeks (2026, 2032 and 2037) coming up. Good news is we can probably argue that we aren’t doing site visits the last week of the year or the first week of the year either.
I might transition to that, just for ease of use.
I wound up going with the UDF flag solution on the client, as I was working on that while waiting for a reply. Still worth the exercise on going through it, because it might wind up being useful for some other purpose later.
Here’s that solution as an alternative if people want to use it, or adapt it for a another purpose of setting/unsetting a flag and then doing something with it.
-
Create a UDF on your client which is a List (single select) and then a value for true and false

-
Set your initial value, though it’s not critical since we’re check for == True and != True, so an empty value is the same as false.

-
Add your processing rules for obtaining the flag from the company and saving it as a variable.
e.g. Looking up company by ID, and storing the found company as global.company
. You can obtain the company id from any value (such as part of an email workflow you already have). In these examples, I just happen to know the company ID and so I hard code it instead of needing to use a variable. In fact, if you already the ID in your workflow, just skip this step and update your reference in step 4 to be the object which refers to the account, leaving the UDF portion in place.
-
Check the current value of the flag and save it as a variable you can use as a condition.
e.g. Using the company from step 3 and obtaining the value of the flag {{global.company.[UDF:Site Visit Required].Value}}
-
Add a conditional wherever you want to perform/not perform the action.
e.g. Only create the ticket if the current value is true
-
Have a pair of rules to check the current value and invert it to the other value. True to False, or False to True in this case.
e.g. True to False
e.g. False (or empty) to True