automation for jira: minusDays(7) returns no value

Jeffrey Bistrong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2023

Trying to figure out why {{issue.customfield_11479.minusDay(2)}} is not returning any values.

 

As you can see in the first log {{issue.customfield_11479}} returns a value, but adding the minusDays(2) it returns nothingMonosnap Automation - JIRA 2023-05-06 17-58-35.png

 

Monosnap Automation - JIRA 2023-05-06 17-55-24.png

1 answer

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2023

Hi @Jeffrey Bistrong 

Please try using minusDays() instead of minusDay(), as I believe all of the plus/minus ones use a plural name for the units of measure:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

Kind regards,
Bill

Jeffrey Bistrong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2023

sorry got caught up in trying lots of the possibilities, but still nothing

Monosnap Automation - JIRA 2023-05-06 18-57-57.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2023

What is the type of that custom field?

If it is not date type, you could add an asDate conversion before making the adjustment.

Jeffrey Bistrong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 7, 2023

it is a date type, but it is a system field, so not sure if that has anything to do with it

 

Monosnap Custom fields - JIRA 2023-05-07 09-30-18.png

 

However after multiple rounds of testing I got the following syntax to work. Thank you for pointing me in the right direction

 

{{issue.customfield_11479.toDate("yyyy-MM-dd").minusDays(7).jiraDate}}

 

Monosnap Automation - JIRA 2023-05-07 09-33-38.png

Like # people like this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 7, 2023

Thanks, and I believe Target Start is one of those advanced roadmap fields which has some oddity with automation rules.  Other built-in/system fields like that are indeed text and not date or date/time type, and so the conversion was needed.  (Another example is the Status Category Changed Date, which is text for a date/time value.)

Like Stefan Salzl likes this

Suggest an answer

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

Atlassian Community Events