Dear all,
I'm trying to create an automation that sets a due date with a given start date and a duration.
When value changed for start date:
It gives an error "Failed to get value for..."
The customfield-ID is the ID of the start date.
If I set the duration field to 4 it shows that the Smart Value X is 4 in the automation log.
If I change the <Smart_Value_X> to a hard coded 4 in the automation it works aswell.
I cant get him to use the smart value in this operation.
I tried with a free text field and a number field for duration.
Start and due date are date fields.
Do you have a Suggestion?
Hi @Felix Köhn
Obviously the bug that variables can´t be used in calculation occurs in DC too.
If there is no urgent need to solve this via variable (as far as I understood the weeks are stored in a customfield of type numbers) I suggest to use the value directly in the calculation (similar to what @Florian Bonniec already mentioned)
some important points to mehtion regarding this solution:
I tested this in a DC and found out that values of numbers fields are stored/returned as float/with digit:
see my example- the field "Effort" is a customfield of type Number and filled with value "3"
so the following line:
weeks: {{issue.Effort}}
returns into:
weeks: 3.0
Therefore the calculation with only using the numbers value in .plusWeeks() failed too.
Nevertheless this can be solved with using the "floor" function to numbers. So the following line in the "Edit issue" action worked for me and the Due Date was updated correctly (replace the "Effort" with your specific customfield´s name):
{{issue.start Date.plusWeeks(issue.Effort.floor)}}
Please let me know if this helps.
Best
Stefan
I saw your working suggestions in different posts and was wondering, if you have an idea or solution for this problem.
Kind Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Felix Köhn
There is an intermittent defect for this symptom for Jira Cloud, where variables cannot be consistently used to increment date / time values...even when converted with asNumber.
I do not know if this defect also applies for Server / Data Center automation, but you could try two workarounds:
{{issue.customfield_12345.plusWeeks(varMyVariable.asNumber)}}
or
{{#issue.customfield_12345}}func=plusWeeks({{varMyVariable}}){{/}}
Assuming customfield_12345 is a date (or date / time) field and varMyVariable can convert to a number, both of these currently work for Jira Cloud.
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.
hey @Bill Sheboy
thank you for your suggestion.
Unfortunately both options do not work in Data Center.
In both cases the field is still empty.
This is definitely a Bug in the Software.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for confirming that. At this point, I would work with your Jira Site Admin to submit this as a defect at the link below. The earlier defect I noted is for Jira Cloud, and it will be good to let Atlassian know the scope of this problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Felix,
Hope you are doing well.
On the last step
try to use (Duration.asNumber) instead of (Duration)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Cristian,
thank you for the suggestion.
with {{issue.customfield_XXXXX.plusWeeks(Duration.asNumber)}} the field is still empty unfortunately.
I also did
And: Add value to the audit log
and added the "End date" issue.customfield to see if it has any content.
The field shows to be empty in the Automation Audit Log too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Felix,
You can try the following.
Provide a value mannualy to Start date and see if the End Date is edited after.
Maybe is a problem beacuse Start date is empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also please make sure that:
When: Value changes for
Then: Create Variable
And: Edit Issue Fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Felix Köhn
Why do you need to use a variable ? Could you not use
{{issue.customfield_<ID>.plusWeeks(4)}}
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
because the duration is variable (not always 4) that can also change at a later date.
If I create a work Package and i know the start date but not the end date, I can freely play around with the duration / start date and have it adjust automatically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share the automation configuration ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When: Value changes for
Then: Create Variable
And: Edit Issue Fields
The Edit Issue Field is the End date
Unfortunately I cannot upload Screenshots.
I'd expect End date = start date + duration
But the End date is empty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the duration is in a field could you use
{{issue.customfield_XXXX.plusWeeks(issue.customfield_YYYY)}}
Where XXXX is the date field and YYYY the duration field ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tested this option and replaced the smart value with the issue.customfield Duration as suggested.
Unfortunately the End Date is still empty.
This seems to be a bug as pointed out by Bill Sheboy
https://jira.atlassian.com/browse/AUTO-957
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ya it's why I do not use variable in that case but I tested the propose smart value on my side and it works fine.
Is End Date a Date and Time or just Date Field ?
My Start date is a Date Field and End Date is in fact DueDate in my test. Duration was stored in a number field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Start and End Dates are both Date fields.
DurationX is a Number field
I also created a second free text field for DurationY so i can test both.
Your working solution is implemented in a Cloud product or Data Center?
Do you mind sharing your working automation with me if its Data Center?
Kind Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's DC 9.12
{{issue.customfield_XXXX.plusWeeks(issue.customfield_YYYY)}}
XXXX is the Start Date field that is Date Picker
YYYY is a Number Field
I only use the trigger then the Edit Action.
Regards
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.