I am trying to build some automation that will update a date field when an action is performed, but only if another date field's value +1w is greater than today's date. I am attempting to accomplish this with scriptrunner's datecompare issuefunction.
Example:
issuefunction in datecompare("", "Due Date +1w > now()")
However, now() is not accepted as a date value here. Is there a way to call the current date in this context?
Hi Steve,
Please clarify: What type of Automation are you using to achieve this? Is it ScriptRunner's Custom Script Automation?
If yes, you could try something like the solution provided in the Community Post. It's not 100% exact, but it's a starting point.
Please let me know if you need assistance with the script.
I am looking forward to your feedback.
Thank you and Kind regards,
Ram
Hi @Ram Kumar Aravindakshan _Adaptavist_
I am using Atlassian's "Automation for Jira" to create the rules. The solution proposed in that post is a lot more complex than I was looking to make this. In the end, I was able to get around this by using smart clauses in the Advanced Compare condition.
i.e.
{{issue.customfield_XXXXX}} is greater than {{now.minusBusinessDays(7).format("yyyy-MM-dd")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Replace now()
with a relative JQL date syntax such as startOfDay()
or a specific number of days ago:
issueFunction in dateCompare("", "'Due Date' +1w > startOfDay()")
Here, startOfDay()
is a valid JQL function that references the beginning of the current day.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have already tried that and unfortunately, startOfDay() is not accepted as a valid date value in the dateCompare issuefunction either.
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.