I am trying to have total duration after capturing deployment duration and testing duration using this kind of code
{{issue.customfield_27710.diff(now.minusHours(1)).plusMinutes(issue.customfield_27711.diff(now.minusHours(1)).minutes)}}
But this is not working for me can someone please guide me on this
Welcome to Atlassian community!
Are you getting any error? Also, what data type were the custom fields 'customfield_27710' and 'customfield_27711'?
Did you try sending the values to log after splitting the above expression? Like, try to send to log these values and see whether you are getting the desired result or error:
{{issue.customfield_27710.diff(now.minusHours(1))}}
{{issue.customfield_27711.diff(now.minusHours(1))}}
Thanks,
Vamsi
I am not getting any error but the values are not appearing it is appearing black, and the customfield_27710 and customefield_27711 are date time picker. Here these two customfields are getting values from other automation at the same time, here is the value for these two custom fields in other automation "{{now.minusHours(1)}}"
Here is the log for that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I am mistaken earlier.
The keyword 'plusMinutes' is used only for adding the required number of minutes to the given date time value and is not used for calculating the sum of the duration of two date fields.
I have tried this workaround and worked for me.
Create 3 custom fields which are of 'Number Field' data type, called 'Deployment_Duration', 'Testing_Duration' and 'Total_Duration'.
In the automation rule, use the 'Edit issue' action component and assign the following like:
Deployment_Duration = {{issue.customfield_27710.diff(now.minusHours(1)).minutes}}
Testing_Duration = {{issue.customfield_27711.diff(now.minusHours(1)).minutes}}
Total_Duration = {{customfield_xxxxx}} + {{customfield_yyyyy}}
Where 'customfield_xxxxx' is the custom field id for 'Deployment_Duration' and 'customfield_yyyyy' is the custom field id for 'Testing_Duration'
Enclosed the screenshot here for your reference.
Hope this helps.
Thanks,
Vamsi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me, but I am facing an issue whenever the automation gets trigerred for this first time it is throwing error but it works fine for the same issue when its trigerred for the second time.
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.