Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Error on Rule that Compare field Value and Set Value

Jack Yang
Contributor
June 1, 2026

Hi everyone,

 

I set a automation rule to compare value between 2 date picker field, if it's less than 3 days, then set another field value to 5, if between 3 and 7 days, set to 4, etc.

Here is the smart value I put in {{issue.Start Date (migrated).daysBetween(issue.Contained Date).abs}}
However, no matter what dates I pick, it all passed first if block (less than 3)

Unable to resolve this even I tried solutions that provided by AI, anyone can help?

 

Screenshot 2026-06-01 at 4.44.58 PM.pngScreenshot 2026-06-01 at 4.45.45 PM.png

 

Thanks in advanced

Jack

2 answers

2 accepted

2 votes
Answer accepted
Yashaswini YK
Contributor
June 1, 2026

Hi @Jack Yang ,

Replace the smart value with:

{{issue.migrated.diff(issue.Contained Date).days.abs}}

and keep the rest of the automation unchanged.

This worked successfully in my instance. I've attached a screenshot below for reference.


Screenshot 2026-06-01 145952.png

Screenshot 2026-06-01 145913.png

Jack Yang
Contributor
June 1, 2026

Thanks @Yashaswini YK for your quick response, it works properly now, thanks again for your help.

1 vote
Answer accepted
Artem Nek
June 1, 2026

Hi Jack,

The problem is the smart value itself: daysBetween isn't a function in Jira
automation, so the whole expression never resolves to a number. With the left
side of your "less than 3" check blank, that first branch passes every time —
which is exactly what your audit log shows.

There's a single date-difference function, .diff(), and you append the unit,
then .abs:

{{issue.Start Date (migrated).diff(issue.Contained Date).days.abs}}

(order is unit-then-abs — straight from the docs, e.g.
{{now.diff(issue.created).days.abs}})

Two things worth checking while you're in there:

1) Confirm it actually resolves. Add a "Log action" (or write it to a temp
field) containing just that smart value and run the rule once — you should
get a number like 5, not a blank and not the raw {{...}} text. If it comes
back blank, the field reference is the culprit: "Start Date (migrated)"
with
the space and parentheses can be unreliable, so try the customfield_XXXXX
id
instead, or add .toDate("yyyy-MM-dd") before .diff() if that migrated field
is being returned as text rather than a date.

2) Check the branch logic. If those are separate "if" blocks rather than one
If / Else-if chain, more than one can fire. For "<3 → 5, 3–7 → 4, …" put
them
in a single If / Else-if and order them narrowest-first so the ranges don't
overlap.

Date function reference

Jack Yang
Contributor
June 1, 2026

Thanks @Artem Nek  for your quick response, it works properly now, thanks again for your help.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events