Hello, I am trying to convert in jira automation, a variable into a date. The variable is caught from the issue description field, where a due date is set as plain text. Next I try to manipulate the date with syntax:
{{Variable.toDate.plusDays(14).format("dd.MM.yyyy")}}
When I try to print out the result, it returns as empty. Log only returns the syntax with any explanation.
The idea is to compare the date from the description (variable) with and if else statement, with todays date.
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
From what you describe and the smart value expression shown, it is likely the variable is not evaluating to a date correctly. Please try writing the variable to the audit log to confirm that.
When actions in rules have conversions like toDate that do not work, they collapse to null and "fail" silently with no error in the log.
Kind regards,
Bill
Sure here's screenshots of the workflow. And the summary field on issure is set to "start 17.10.2024 end".
My goal is to create a scheduler that compares dates daily, and does magic if the if else statement is met or not
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This confirms the initial parsing to get the date in the variable is incorrect.
Please show an example of, and write to the audit log, the Summary for the trigger issue as that will help confirm how to adjust the parsing. That will also help when the rule fails in the future as...
This is a risky rule / solution approach. Putting a date value in the summary in a way that could be interpreted as either dd-MM-yyyy versus MM-dd-yyyy by a person may cause entry or understanding errors. Is this date entered by a person or created with some automated source?
Next, there is an error in your condition as it tries using jiraDate as a value rather than now. jiraDate is a format. (Please see below.)
Finally, to avoid the risk of a typo / error in the date comparisons, I recommend using jiraDate rather than the format() command. For example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Here's more screenshots. from summary, modified dates and log.
<--Summary
The dates come from an automated message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please post your current, updated rule in a single image? Posting in a single image will confirm the step order / context.
If the rule is too large for one browser page, you could use a scrolling page browser addon or app to capture the image.
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.