Scenario: Epic link changes on a story. Automation goes out and looks up the original Epic and updates the number of issues assigned to the Epic and adjusts the number of Story Points in the Epic.
Problem: I have a duplicate automation that is supposed to do the same thing for the Target Epic...ie the one that the story moves to. That automation is failing and I can't figure out why. I've mirrored the Source automation, changing {{toStiring}} to {{fromString}}, but it fails for some reason.
Here is the JSON for the automation:
{"cloud":true,"rules":[{"id":13834518,"clientKey":"d88b9191-773c-3001-ac86-ac5e2a5ecd89","name":"4.Update SP and Nbr of Issues - Epic link changed - Target","state":"DISABLED","description":"","authorAccountId":"712020:977bff7a-a0c5-4ee1-ac25-7c01a7a56f5b","actor":{"type":"ACCOUNT_ID","value":"557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"},"created":1690894366868,"updated":1691591066271,"trigger":{"id":"302225689","component":"TRIGGER","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"jira.issue.event.trigger:updated","value":{"eventKey":"jira:issue_updated","issueEvent":"issue_updated"},"children":[],"conditions":[],"connectionId":null},"components":[{"id":"302225691","component":"CONDITION","parentId":null,"conditionParentId":null,"schemaVersion":3,"type":"jira.issue.condition","value":{"selectedField":{"type":"ID","value":"issuetype"},"selectedFieldType":"issuetype","comparison":"NOT_ONE_OF","compareValue":{"type":"ID","modifier":null,"value":"[\"10000\",\"10010\",\"10490\"]","multiValue":true,"source":null}},"children":[],"conditions":[],"connectionId":null},{"id":"302225693","component":"CONDITION","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"jira.comparator.condition","value":{"first":"{{#changelog.epic link}}{{toString}}{{/}}","second":"Empty","operator":"NOT_EQUALS"},"children":[],"conditions":[],"connectionId":null},{"id":"302225695","component":"BRANCH","parentId":null,"conditionParentId":null,"schemaVersion":1,"type":"jira.issue.related","value":{"relatedType":"jql","jql":"issue = {{#changelog.epic link}}{{toString}}{{/}}","linkTypes":[],"onlyUpdatedIssues":false,"similarityLimit":40,"compareValue":0},"children":[{"id":"302225697","component":"ACTION","parentId":"302225695","conditionParentId":null,"schemaVersion":1,"type":"jira.lookup.issues","value":{"id":"_customsmartvalue_id_1689086516698","name":{"type":"FREE","value":"lookupIssues"},"type":"JQL","query":{"type":"SMART","value":"\"Epic Link\" = {{#changelog.epic link}}{{toString}}{{/}}"},"lazy":false},"children":[],"conditions":[],"connectionId":null},{"id":"302225698","component":"ACTION","parentId":"302225695","conditionParentId":null,"schemaVersion":1,"type":"codebarrel.action.log","value":"New Epic Link value: {{#changelog.epic link}}{{toString}}{{/}}","children":[],"conditions":[],"connectionId":null},{"id":"302225699","component":"ACTION","parentId":"302225695","conditionParentId":null,"schemaVersion":1,"type":"codebarrel.action.log","value":"Original Epic Link value: {{#changelog.epic link}}{{fromString}}{{/}}","children":[],"conditions":[],"connectionId":null},{"id":"302225700","component":"ACTION","parentId":"302225695","conditionParentId":null,"schemaVersion":1,"type":"codebarrel.action.log","value":"Total SP after issue is removed from Epic: {{lookupIssues.story points.sum|0}}","children":[],"conditions":[],"connectionId":null},{"id":"302225701","component":"ACTION","parentId":"302225695","conditionParentId":null,"schemaVersion":1,"type":"codebarrel.action.log","value":"Nbr of issues after issue is removed from Epic: {{lookupIssues.size|0}}","children":[],"conditions":[],"connectionId":null},{"id":"302225702","component":"ACTION","parentId":"302225695","conditionParentId":null,"schemaVersion":10,"type":"jira.issue.edit","value":{"operations":[{"field":{"type":"NAME","value":"Total Number of Story Points"},"fieldType":"com.atlassian.jira.plugin.system.customfieldtypes:float","type":"SET","value":"{{lookupIssues.Story Points.sum|0}}"}],"advancedFields":null,"sendNotifications":true},"children":[],"conditions":[],"connectionId":null},{"id":"302225704","component":"ACTION","parentId":"302225695","conditionParentId":null,"schemaVersion":10,"type":"jira.issue.edit","value":{"operations":[{"field":{"type":"NAME","value":"Number of Issues per Epic"},"fieldType":"com.atlassian.jira.plugin.system.customfieldtypes:float","type":"SET","value":"{{lookupIssues.size}}"}],"advancedFields":null,"sendNotifications":true},"children":[],"conditions":[],"connectionId":null}],"conditions":[],"connectionId":null}],"canOtherRuleTrigger":false,"notifyOnError":"FIRSTERROR","projects":[],"labels":[],"tags":[{"id":39373668,"tagType":"IS_RULE_UPDATED","tagValue":"true"}],"ruleScope":{"resources":["ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10191","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10072","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10171","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10192","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10176","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10145","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10112","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10172","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10183","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10164","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10152","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10119","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10129","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10038","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10117","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10007","ari:cloud:jira:78db38a2-52b2-44cf-ac8f-1689cf94905f:project/10149"]},"ruleHome":{"ruleLifeCycleHome":{"locationARI":"ari:cloud:jira-software::site/78db38a2-52b2-44cf-ac8f-1689cf94905f"},"ruleBillingHome":{"locationARI":"ari:cloud:jira-software::site/78db38a2-52b2-44cf-ac8f-1689cf94905f"}},"writeAccessType":"UNRESTRICTED","collaborators":[],"billingType":"NORMAL"}]}
It fails with this error:
The following issues passed:
The following issues passed:
Error searching for related issues. This is most likely because the following issues don't have a related issue of the type you specified. Try narrowing your search to only include issues that contain links to related issues:
TFM-5280: "((issue = ) AND (key != TFM-5280)) AND (project in (10192,10191,10172,10183,10072,10171,10152,10129,10117,10007,10119,10176,10164,10145,10112,10149,10038))" - Error in JQL Query: Expecting either a value, list or function but got ')'. You must surround ')' in quotation marks to use it as a value. (line 1, character 11)