Hi everyone,
I am trying to automate the change of the Active Directory title for employees when HR sends us an email.
I was able to extract the date in ISO format from the ticket description as well as several other pieces of information using this logic:
{{ ticket.description | strip_html | replace: " ", " " | split: "Date du changement:" | last | strip | split: " " | first }}
(This allows us to extract the date and return: “YYYY-MM-DD”)
Subsequently, I added an expression builder that looks at today's date and the remaining days before the change date:
diffInDays(today('America/Toronto'), '{{E3.result}}')
Here, {{E3.result}} represents the date in ISO format obtained in the previous step.
Then, I configured a condition specifying that if the number of days is EQUAL “0”, then continue; otherwise, the employee's title needs to be changed now, as this means the change is prior to today's date. Again, everything works without any issues.
My problem arises with a change that needs to be made in the future.
For example, if the change need to be made on: 2025-05-05, it doesn't work. Even though I added a condition indicating that if {{E4.result}} = 0, take action and change the title. (HERE, {{E4.result}} represents the number of days remaining.)
However, I am unable to add a waiting timer between today's date and the number of days remaining, because Human Resources often makes requests 3-4 months in advance.
Therefore, the ticket needs to remain open until the day of the change, the change needs to happen once the remaining days reach “0,” and then the ticket should be closed.
Im sorry, I use AI to translate the text, because Im mainly french. Do not hesitate if you need more informations or anything on that.
I am wondering if you have an explanation or a solution for this.
Thank you again for your time, and have a great day.