Hi,
we are implementing scheduled tasks. For this we create asset objects with e.g. a startDate, a frequency with a duration.
An automation looks every day if there are tasks to create.
My idea was to calculate a new date and compore it to {{now}}.
But in my tests i get no results.
Object:
{{object.Startdate.plusMonths(object.Frequenz.PlusTime)}}
or
{{object.Startdate.jiraDate.plusMonths(object.Frequenz.PlusTime)}}
But I can't get a result in my logs. This also if I create another variable with plusTime.
Where is my mistake? Is there another way which I do not see?
Edit:
I make it easier:
1. create a variable "plus" with value "3"
2. log {{object.Startdate}}: 2025-05-01T00:00:00.0+0000
3. log {{plus}}: 3
4. log {{object.Startdate.plusMonths(plus)}}: EMPTY
5. log: {{object.Startdate.plusMonths(3)}}: 2025-08-01T00:00:00.0+0000
BR Christof
@Raphael Lopes you were on the right way. What was your prompt?
It works with
{{object.Startdate.plusMonths(plus.asNumber)}}
Well done solving your own question!
For more information on using variables as numbers with the various rule function types, please see this article I wrote on the topic:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Christof Hurst, and welcome to the Community!
You're definitely on the right track with the concept — using Assets objects with startDate and a repeat interval to trigger scheduled tasks via automation. But there are a few gotchas when working with date calculations and custom object references in Assets automations.
Let’s go step-by-step to understand what’s likely causing your issue.
Problem Breakdown
You mentioned this expression:
{{object.Startdate.plusMonths(object.Frequenz.PlusTime)}}
And that it returns no value in your logs. Here are potential causes:
Startdate must be a valid date (Date type in Assets)
Make sure that:
Frequenz.PlusTime must be accessible as a number
If Frequenz is a referenced object, you cannot access PlusTime directly with . in smart values like object.Frequenz.PlusTime unless:
In practice, Assets smart values don’t support full object traversal like this out of the box in Jira Automation.
How to Fix It (Recommended Pattern)
Here’s a working pattern I’ve seen used in similar setups:
Step 1: Use a variable for the duration
Let’s assume you want to calculate:
Startdate + 3 months
Do this:
{{object.Startdate.plusMonths(3)}}
This should return a proper date. Test this first to confirm that Startdate is parsed correctly.
Step 2: Try storing the PlusTime as a direct attribute (on the same object)
If you move PlusTime to be on the same object (not via a reference like Frequenz), then you can safely write:
{{object.Startdate.plusMonths(object.PlusTime)}}
This works because object.PlusTime is a direct number field — much more reliable in automation.
Step 3: Debugging the values
Add a Log action with the following lines to validate if you’re getting anything:
Startdate: {{object.Startdate.jiraDate}}
PlusTime: {{object.Frequenz.PlusTime}}
Combined: {{object.Startdate.plusMonths(3)}}
If any of these return blank, you know where the chain is breaking.
Bonus: Dynamic unit logic (optional)
If you're handling durations like "monthly", "quarterly", etc., you might consider:
{{#if(equals(object.Frequency, "quarterly"))}}
{{object.Startdate.plusMonths(3)}}
{{/if}}
I really hope you.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thx.
Option 1 and 2 are no options.
Every value is debugged and contain the correct value.
{{object.Frequenz.PlusTime}} = 3
I need to do this all dynamically and there must be solution.
Of course I asked AI too as your answer also seems to be generated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christof,
You're right — the issue is not with the values, but how Jira handles them in expressions like .plusMonths().
Even though {{object.Frequenz.PlusTime}} returns 3, Jira doesn’t treat it as a number inside plusMonths() unless you set it explicitly.
Maybe:
Use #set to coerce the value before using it:
{{#set(plus, object.Frequenz.PlusTime)}}
{{object.Startdate.plusMonths(plus)}}
{{/set}}
This makes Jira treat it as a number, and the date calculation will work.
Let me know if you need help comparing it to {{now}} after that!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thx, where is this documented? I didn't find anything in the docu.
I do not think "set" is a valid syntax. this returns also no value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.