Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you might find the site temporarily inaccessible. Thanks for your patience. Read more.
×I'm trying to build an automation to cancel any issue created with a due date shorter than 48h.
However, we use a custom field to determine the due date of our issues.
I did some research, but I wasn't able to find anything that helps with my case... Most of any date operations I found are not accepted on Advanced Search, and therefore I can't really test the Automation JQL, since the syntax is not always the same and I wouldn't have any idea of what I may be doing wrong.
Ideally, it would compare the CF Due Date with the Creation Date +2 days... comparing the CF Due Date with now(+2d) would be just fine, but it seems this is not acceptable.
(p.s.: I can't install any type of extensions/plugins - like ScriptRunner, I'm the project admin but not admin for the Jira instance, so any setting or installation to the project is most probably out of my reach)
I do not believe that comparison is possible with the built-in features of JQL.
However if your rule used other criteria to find the issues first, rule conditions could be used. For example:
You may want another rule, triggered on a change to the due date field, in the event someone sets the due date after issue creation.
Kind regards,
Bill
I'm sorry but I'm not sure I follow...
Should I use an Advanced Compare and use
{{issue.cf_[22222]}} [less than] {{now.plusDays(2)}}
Or maybe
{{issue.cf_[22222].diff(now.plusDays(2).days}} [less than] 2 ...
Since I can't validate Smart Values, it's difficult to decide what's the best way to proceed....
Thank you for taking your time and trying to help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the first one, they will not necessarily compare correctly unless put into a known format. For example you could also compare:
{{issue.cf_[22222].jiraDate}} less than {{now.plusDays(2).jiraDate}}
That would but both in the format "YYYY-MM-dd", allowing the less than to work as expected.
I recommend using the second one with the diff() function, and writing the smart values to the audit to confirm what they contain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Bill! I used an IF with Advanced Compare Condition, filled with
` {{issue.cf_[22222].diff(now.plusDays(2).days)}} [less than] 2 `
and it worked like a charm. Once again, thanks for your will to help!
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.