Error rendering smart-values when executing this rule: Division undefined: 0 / 0 * 100
Asked by divya krishna:

Derive the status-wise percentage completion of Epic based on the 'Status' and 'Effort' available at Feature level

Each of the above fields can have a percentage value. You have to calculate the percentage value for each of the above based on the status of the Features under that particular Epic, and the 'Effort' values mentioned in the Features.

Every feature can have ++one of the following++ 3 statuses.

1. To Do
2. In Progress
3. Done

**Demonstration**

Assume that a particular Epic has 6 Features under it. Following table shows what is the Status of each of those 6 Features available under a particular Epic and the corresponding Effort Hours.

|-------------|-------------|-----------|
| **Status and Effort at Feature Level** |||
| **Feature** | **Status**  | **Hours** |
| Feature 1   | To Do       | 40        |
| Feature 2   | Done        | 30        |
| Feature 3   | In Progress | 60        |
| Feature 4   | Done        | 80        |
| Feature 5   | Done        | 40        |
| Feature 6   | In Progress | 50        |
|             |             | 300       |

**Following should be the result of the automation: -**

|-------------|-----------------|-------|
| **Summary at Epic Level**    ||       |
| **Status**  | **Total Hours** | **%** |
| To Do       | 40              | 13%   |
| In Progress | 110             | 37%   |
| Done        | 150             | 50%   |

You can ignore the 'Total Hours' field in the table above. It is to help you to understand how the percentage was derived. As mentioned above, the Epic will have 3 fields (To Do, In Progress, Done). Against 'To Do' field, you have to populate "13%", against 'In Progress' field, you have to populate "37%" and against 'Done' field, you have to populate "50%".


Answers:
author: Kalyan Sattaluri
body: Hello [@divya krishna](/t5/user/viewprofilepage/user-id/1598824)

From your post, looks like your issue hierarchy is, Epic -\> Feature -\> Story and you want to count Features which are in To Do, In Progress and Done and calculate their %s and store them in Epic's fields. Nothing to do with "hours" as listed in your original post. Is this correct?

If so, why then is your JQL restricting it to story?

Anyways, for me to suggest any solutions, I need clarification on what issue type is your Trigger in this rule and the hierarchy you are looking to do this at.

I dont want to suggest something for it to be wrong and confuse you further... but basics are:

* - All your lookups should be outside of your branch OR, use triggerissue.key instead of issue.key.
* - Depending on your hierarchy and your requirement, you need to either use "Epic Link" or "Parent Link" in your JQL.
* - Finally, depending on how your system is set up and issue type, you may have to use Branch -\> Parent or Branch -\> JQL to find the parent to edit or make a REST call. This is provided you have all issues in same project or you have scope to add multiple projects if your Epic (Feature) is in different project than your Feature (or story).

So please share some details on,

* What issue type is your trigger and how is your hierarchy is set up?
* what exactly are you calculating, % in To Do, etc? or Hours (?) and of what?
* which issue type you want to count / calculate (Feature or Story?) and also,
* are all your issues in the same project?


author: divya krishna
body: * an image of your complete automation rule, in one single image

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

* images of any relevant actions where the rule does not work as expected![smartvalue.png](https://community.atlassian.com/t5/image/serverpage/image-id/321002i38D5F01504B8861D/image-size/large?v=v2&px=999 "smartvalue.png")
* an image of the audit log details showing the rule execution
* ![error.png](https://community.atlassian.com/t5/image/serverpage/image-id/321003i3087B6FDE4E94B26/image-size/large?v=v2&px=999 "error.png")


author: Bill Sheboy
body: Hi [@divya krishna](/t5/user/viewprofilepage/user-id/1598824)

What have you done thus far to solve this need?

If you have an automation rule which is not working as expected, please provide:

* an image of your complete automation rule, in one single image
* images of any relevant actions where the rule does not work as expected
* an image of the audit log details showing the rule execution

These will provide context for the community to offer suggestions.

If you have not started a rule yet, I recommend trying to do so. That will help you learn about creating automation rules and clarify any challenges in solving the scenario.

Kind regards,  
Bill

comments: author: Bill Sheboy
body: Thanks for that information, [@divya krishna](/t5/user/viewprofilepage/user-id/1598824)

Please keep to one thread when posting; that will help others looking at this question in the future know if there are multiple possible answers. Thanks!

For Jira Server / Data Center, I believe you want to use the "Epic Link" field and not "parent" for this scenario. Please change your JQL statements in the lookup issues actions and re-test.


Tags: data-center

jira

jira-data-center

jira-server

server