Hi,
Story is linked to BPT or Interface with linked name "Connection Child" ( This is project need) i am trying to Sum the time tracking but it says no action performed Automation is below in scheduled i have given issue key of Story, Even if i remove the If:Linked issues condition it doesnt work, Can anyone help what should be the calculation as I think lookup wont work in this case
Calculation for updating time tracking is
{
"fields": {
"timetracking": {
"originalEstimate" : "{{lookupIssues.Original Estimate.sum .divide(60)}}",
"remainingEstimate" : "{{lookupIssues.Remaining Estimate.sum .divide(60)}}"
}
}
}
I Even tried below -
{
"fields": {
"timetracking": {
"originalEstimate": "{{issue.timetracking.Original Estimate.sum .divide(60)}}",
"remainingEstimate": "{{issue.timetracking.Remaining Estimate.sum .divide(60)}}"
}
}
}
Hello @Sanjivani Wayal
Whenever asking for help with an Automation that is running but not providing the expected results it is helpful to us if you also provide the details available in the Audit Log for the execution of the rule.
Using the For Each Parent branch will try to look for the issue designated as the parent. That is the issue identified in the Parent field. This is not the appropriate option for issues that are connected through Issue Linking. In your case the branch is trying to find the parent Epic for the Story, and then find issues linked to the Epic.
To ensure we understand your scenario correctly can you provide a screen image of the issue where you want the sum recorded, including in that image the portion of the screen that shows the issue's relationship to the linked issue you want to sum up?
LOGS are below -
Log
SmartTimetrackingBean{source=TimetrackingBean{originalEstimate='null', remainingEstimate='null', timeSpent='null', originalEstimateSeconds=0, remainingEstimateSeconds=0, timeSpentSeconds=0}} TimetrackingBean{originalEstimate='null', remainingEstimate='null', timeSpent='null', originalEstimateSeconds=0, remainingEstimateSeconds=0, timeSpentSeconds=0}
Changed the automation as below -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also below is field of Main issue where i need to sum the values from Stories
Below is the link type used -
And this is value in Story -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Sanjivani Wayal
When I asked about the details of the audit log I meant all the details for a full execution of the the rule. There should've been more entries in the log for the one execution than just the entry for the Log action.
When you put a branch into your rule, the effect is that the focus shifts from the issue that triggered the rule to the issue selected by the branch. The actions and conditions you have within the branch are going to be applied to the issues found by the branch.
With the latest version of your rule, your For Each branch is shifting the focus to the linked issues, printing information from the linked issues, and then trying to edit the linked issues, because the Log and Edit actions are within the branch.
Instead, use the Lookup Issues action to execute a JQL statement to find the linked issues. That will give you an object that contains the linked issues. This function gives you the linked issue of a particular link type related to a specified issue.
https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedIssues--
issue in ({{triggerIssue.key}},"Connection child")
You'll want to confirm that you got some issues back from that action using an Advanced Compare to check the size of the list.
{{lookupIssues.size}}
greater than
0
You can then get the sum of values of a numeric field in that collection of issues using the smart value
{{lookupIssues.fieldName.sum}}
Time duration values are typically stored in seconds. You may have to so take that into consideration when using that sum to set the value of the Story.
I recommend that you try the rule first by using just Log actions to print the information you want to use into the rule execution audit log, and then add the Edit action after you confirm you are getting the correct values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill , Thanks i was able to get Sum of Original Estimate and Remaining estimate but while fetching Time Spent its giving error and iam using below -
{
"fields": {
"timetracking": {
"originalEstimate" : "{{lookupIssues.Original Estimate.sum .divide(60)}}",
"remainingEstimate" : "{{lookupIssues.Remaining Estimate.sum .divide(60)}}"
"timeSpent" : "{{lookupIssues.time Spent.sum .divide(60)}}"
}
}
}
also i tried "timeSpent" : "{{lookupIssues.timeSpent.sum .divide(60)}}" and
"timeSpent" : "{{lookupIssues.Time Spent.sum .divide(60)}}" , am I doing something wrong here?
i want this as i need to get formula working (Time_Spent/(time_Spent+ Time_Remaining)
and iam getting below error for Time Spent only
Error while parsing additional fields. Not valid JSON.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe the timeSpent smart value is the human-readable one (e.g., 1h 15m) and timeSpentSeconds is the numeric one.
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.
Hi,
Tried using
"timeSpentSeconds" : "{{lookupIssues.TimeSpent.sum .divide(60)}}"
Still not working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was describing the smart values for reading the information, and not writing it with JSON. That is, when getting the values from the lookup.
Please review the advanced edit with JSON for logging time or updating time tracking. To log time, timeSpent is used in a separate update action:
Also please note: you have an extra space in the smart value expression after the sum function, and that will not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please show us your complete rule again since you have made changes to it, including the details of each step in the rule, and also all the details from the audit log for the execution of the rule?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Below is screenshot of my Rule and its details purposely i have kept both log work and edit just to check logs
1) For Lookup issues -issue in linkedIssues({{issue.key}}, "Connection child ")
which is working and getting story under the parent issue
2) For Log work - {{lookupIssues.worklog.timeSpentSeconds}} (date Started is {{now}}) this is not working and giving me error
Error trying to log work against an issue
Worklog must not be null., You must indicate the time spent working. (timeLogged)
whereas the story is having 1d as time spent
3) Edit Issues -
{
"update": {
"worklog" : [
{
"add": {
"timeSpentSeconds" : "{{{{lookupIssues.timeSpentSeconds}}}}"
}
}
]
}
}
i just need a sum of time spent on parent issue
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.
As noted earlier, to log work with JSON use the timeSpent smart value. This is different than when just reading the information as a number.
And there appear to be extra curly brackets in your JSON expression. Please try this one:
{
"update": {
"worklog" : [
{
"add": {
"timeSpent" : "{{lookupIssues.timeSpentSeconds.sum|0}}"
}
}
]
}
}
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.