Hi!
I hope someone might be able to answer a puzzling scenario.
I am trying to create a manually run automation rule that provides me a sum total across linked issues so we can see how much time is spent by both the SD Agents and the 3rd line Support team for completing an issue. Our Account team would like to be able to do this with the click of a button in JSM instead of having to export to csv, then manipulate the output to give the total.
This should catch all "causes" issues if there are more than one.
I can get the worklog.timespentseconds from JSM
{{issue.worklog.timeSpentSeconds}}
I can get the worklog of {{issuelinks.outwardIssue.worklog.timespentseconds}}
The automation log shows this:
When I amend the second smart value to {{issuelinks.outwardIssue.worklog.timespentseconds.sum}} I get no value.
My expectation was this would return an 18000 summed total second value. At that point I could simply add them and divide by 3600 to get minutes spent total.
I referred to this previous question:
but for some reason the sum doesn't add the array values as expected to provide a total linked issue value which I can then add to the JSM total.
Does anyone have any ideas on how to solve this? Or is it a bug in the sum function that the A4J team need to address?
Thanks in advance
Warren
To provide some context, would you please post images of your complete rule, details of the summation/edit components used, and of the audit log details showing the rule execution? Thanks!
Kind regards,
Bill
Hi @Bill Sheboy
Thanks for taking the time to look at my query.
This is the rule and the two variables I am checking in the log:
And this is the result of the two different smart value returning the results.
The first image shows it producing the worklogs second values, which seems to be as an array of values, when I don't use the .sum on the outward issue variable.
The second one shows an empty result when I add the .sum to aggregate the values into a total seconds amount
Thanks
Warren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the variable tweaked with the .sum added to which produces the second log above. Its weird as I thought the aggregate would simply add value 1 to value 2 to produce the sum total of the worklog, and then I can simply add the two and then divide to get total mins! Logically it seems sound but I am hitting a brick wall.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wonder if that time value is text (because of possible units of measure). Perhaps try adding .asNumber.sum to convert before summation.
Also, smart values are case-sensitive, and I note you made that one all lower case. Perhaps try making it match your first variable and the documentation: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--worklog--
Unfortunately when we enter invalid smart values in a rule, they often just collapse to null rather than showing an error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for you input. I eventually managed to get it to work :-)
For those who may be interested this is how I did it:
{{issue.timetracking.timeSpentSeconds.plus(issuelinks.outwardIssue.timetracking.timeSpentSeconds.sum)}}
This basically takes the current issues time tracking logs and adds it to the linked issues totals to get a sum of seconds across all items.
I simply then cast that into hours as a new variable thus:
{{#=}}{{currenttotal}} / 3600{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.