I am stuck at a problem that probably shouldn't be one.
I want to calculate a future date with Jira automation. The date is x-hours from a given timestamp, where x is a number of hours provided by the Issue.
To calculate the future date, I tried:
{{now.plusHours({{hours}})}}
and
{{now.plusHours(hours)}}
because I wasn't 100% certain about the correct syntax.
The first just returns nothing if I try to log the value, the latter just throws the error
Failed to get value for now.plusHours({{hours: {{now.plusHours({{hours}})}}
To isolate the Issue, I already tried to set hours to a fixed value (e.g. 300) with no success.
Also, I tried the aforementioned syntax directly with a fixed value
{{now.plusHours(300)}}
which works just fine.
So I guess the core-question is: How to reference Smart-Values within Functions?
What am I missing?
You can use something like
{{now.plusHours(issue.hours | 1)}}
where 1 is default value if issue.hours does not exists. Hopefully this answers your query.
Cheers
Sherry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try the fully qualified field name so instead
{{now.plusHours(hours)}}
use
{{now.plusHours(issue.hours)}}
If this does not work try
{{now.plusHours(issue.customfield_xxxxx)}}
Where xxxxx is the field’s numerical ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, that works kind of the way I would expect.
But what, If the value hours wasn't supplied directly by the user but instead created within the automation script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you modify field within an automaton script and want to refer to that value later within the same script you have to reload the issue. There is a workflow action called „refresh issue“ or something like that.
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.