Hi!
I am trying to use automation to set the start date of issues based on the Due Date.
This is what I tried so far:
1) Define a variable to get Original estimate in days, based on 8h days:
Variable Name: estimateDays
Variable Smart Value {{#=}}{{triggerIssue.timeoriginalestimate}} /60/60/8 {{/}}
After testing by printing to a text field, the variable outputs the correct value of the Original Estimate in days.
2) define action to edit the Start date to:
{{triggerIssue.Due Date.plusBusinessDays({{estimateDays}})}}
I got the audit message
Error rendering smart-values when executing this rule:Failed to get value for triggerIssue.Due Date.plusBusinessDays({{estimateDays: {{triggerIssue.Due Date.plusBusinessDays({{estimateDays}})}}
Replacing the variable by a specific number of days (e.g. 5) will work. But it seems anything other than an integer here will not work.
Is my syntax wrong or is this really a limitation of minusBusinessDays()? And is so, does anyone know of an alternative way to do this using automation? We do not use or plan to use ScriptRunner.
Thank you!
Hi @Diogo Teles, what you're trying to do is possible. There are just a few additional things to recognize about smart values before it'll work.
Here is the solution that you're looking for, I'll explain it below.
Two things:
1. Once you're insight of the handlebar syntax `{{`, you don't need to use it again to reference variables.
2. The create variable action stores the variable as a string, so one needs to use the asNumber function to coerce it into a type appropriate for use inside plugBusinessDays.
Hope that helps. :)
Thank you so much! I was so close, during one of my tries, I did use asnumber but to create another variable. Which, from what you explained here, was pointless as it converts it to string again. Then tried to use that variable for the plusdays(). I did call it without {{}} at one point but it just deleted the date. Now I see that was because it had a string in the input.
I really appreciate the example and the explanation, thanks.
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.