How do I sum up Story in tasks to the linked story ?
Asked by homesfy987:

Say there are 5 tasks linked to a story, I want to add the story points of those tasks and sum it up on the story. I have done this with sub-tasks and tasks and it's working but I am not able to do this with Stories although I am using the same logic.   

Below you will find what I have tried   

<br />

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/345069iBD256AF86FAA70CA/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/345072iF5DBB0DD36FCFE54/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/345073i3A2AA6D6CFC2FEF0/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/345074iF932495A5B6D1D0F/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/345075iE1213D519BA74526/image-size/large?v=v2&px=999 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/345076i6FAFF2E304095476/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Himanshi
body: Hello [@home](/t5/user/viewprofilepage/user-id/5442582) ,

Welcome to the community!

Can you please share the error or behaviour of automation rule in question and JSON file of the automation rule post sanitising your personal details please.

I will try to give it a shot by importing the same in my test instance and tweaking it a bit.

Ideally the JQL you are using to fetch the task is not correct instead of the same you might need to use Branch operation like below :

![Screenshot 2024-09-02 at 5.21.26?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/345084i1386A0A2E80AD81E/image-size/large?v=v2&px=999 "Screenshot 2024-09-02 at 5.21.26?PM.png")

comments: author: homesfy987
body: Hi Himanshi,   

I don't see an error message in the Automation Workflow.   
But here's the JSON of the Automation :   

*** ** * ** ***

{  
"cloud": true,  
"rules": \[  
{  
"id": 20867451,  
"clientKey": "CLIENT_KEY",  
"name": "SumOfTaskStoryPointstoStories",  
"state": "ENABLED",  
"description": "",  
"authorAccountId": "ACCOUNT_ID",  
"actor": {  
"type": "ACCOUNT_ID",  
"value": "557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"  
},  
"created": 1722510103925,  
"updated": 1722510385109,  
"trigger": {  
"id": "549398461",  
"component": "TRIGGER",  
"parentId": null,  
"conditionParentId": null,  
"schemaVersion": 2,  
"type": "jira.issue.field.changed",  
"value": {  
"changeType": "ANY_CHANGE",  
"fields": \[  
{  
"value": "Story Points",  
"type": "fieldName"  
}  
\],  
"actions": \[  
"edit"  
\]  
},  
"children": \[\],  
"conditions": \[\],  
"connectionId": null  
},  
"components": \[  
{  
"id": "549398462",  
"component": "CONDITION",  
"parentId": null,  
"conditionParentId": null,  
"schemaVersion": 3,  
"type": "jira.issue.condition",  
"value": {  
"selectedField": {  
"type": "ID",  
"value": "issuetype"  
},  
"selectedFieldType": "issuetype",  
"comparison": "EQUALS",  
"compareValue": {  
"type": "ID",  
"modifier": null,  
"value": "10015",  
"multiValue": false,  
"source": null  
}  
},  
"children": \[\],  
"conditions": \[\],  
"connectionId": null  
},  
{  
"id": "549398465",  
"component": "ACTION",  
"parentId": null,  
"conditionParentId": null,  
"schemaVersion": 1,  
"type": "jira.lookup.issues",  
"value": {  
"id": "_customsmartvalue_id_1722509555262",  
"name": {  
"type": "FREE",  
"value": "lookupIssues"  
},  
"type": "JQL",  
"query": {  
"type": "SMART",  
"value": "project='CRM3.0 - Myapp + Beta + Keys' and issueType=Task "  
},  
"lazy": false  
},  
"children": \[\],  
"conditions": \[\],  
"connectionId": null  
},  
{  
"id": "549398468",  
"component": "ACTION",  
"parentId": null,  
"conditionParentId": null,  
"schemaVersion": 1,  
"type": "jira.create.variable",  
"value": {  
"id": "_customsmartvalue_id_1722509727245",  
"name": {  
"type": "FREE",  
"value": "SumOfTaskStoryPoints"  
},  
"type": "SMART",  
"query": {  
"type": "SMART",  
"value": "{{lookupIssues.Story Points.sum}}"  
},  
"lazy": false  
},  
"children": \[\],  
"conditions": \[\],  
"connectionId": null  
},  
{  
"id": "549398469",  
"component": "BRANCH",  
"parentId": null,  
"conditionParentId": null,  
"schemaVersion": 1,  
"type": "jira.issue.related",  
"value": {  
"relatedType": "jql",  
"jql": "project = 'CRM3.0 - Myapp + Beta + Keys' and issueType=Story",  
"linkTypes": \[\],  
"onlyUpdatedIssues": false,  
"similarityLimit": 40,  
"compareValue": 0  
},  
"children": \[  
{  
"id": "549398470",  
"component": "ACTION",  
"parentId": "549398469",  
"conditionParentId": null,  
"schemaVersion": 12,  
"type": "jira.issue.edit",  
"value": {  
"operations": \[  
{  
"field": {  
"type": "NAME",  
"value": "Story Points"  
},  
"fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:float",  
"type": "SET",  
"value": " smart value: {{SumOfTaskStoryPoints}}"  
}  
\],  
"advancedFields": null,  
"sendNotifications": true  
},  
"children": \[\],  
"conditions": \[\],  
"connectionId": null  
}  
\],  
"conditions": \[\],  
"connectionId": null  
}  
\],  
"canOtherRuleTrigger": false,  
"notifyOnError": "FIRSTERROR",  
"projects": \[\],  
"labels": \[\],  
"tags": \[  
{  
"id": 80584120,  
"ruleIdUuid": null,  
"tagType": "IS_RULE_UPDATED",  
"tagValue": "true"  
}  
\],  
"ruleScope": {  
"resources": \[  
"ari:cloud:jira:4efeb0a9-5a5e-460b-9471-a0a4d89f5e98:project/10020"  
\]  
},  
"ruleHome": {  
"ruleLifecycleHome": {  
"locationARI": "ari:cloud:jira:4efeb0a9-5a5e-460b-9471-a0a4d89f5e98:project/10020"  
},  
"ruleBillingHome": {  
"locationARI": "ari:cloud:jira-software::site/4efeb0a9-5a5e-460b-9471-a0a4d89f5e98"  
}  
},  
"writeAccessType": "UNRESTRICTED",  
"collaborators": \[\],  
"billingType": "NORMAL",  
"idUuid": "01910d9a-5575-736a-a103-3881acfc1259"  
}  
\]  
}


author: homesfy987
body: [@Himanshi](/t5/user/viewprofilepage/user-id/5188557) waiting for your response


Tags: cloud

jira-cloud