Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×Hello Folks.
I am working on a company-managed project. I have created one custom fields 'percentage completion' for Epics which will show the progress of epics (depends on the task status to Done). The tasks are the child of epics in my project.
To manage this setup, I am using Jira automation rule. I create the rule and using the template {{#=}}{{#lookupWorkItems}}{{#filter(status = "Done")}}{{/}}{{size}}{{/}} / {{lookupWorkItems.size}} * 100{{/}}. The screenshot below shows my rule setup.
After I enable/activate the above rule, I see the epic percentage is getting calculated in the main page. But the problem is, I don't see the same value populated in the custom field 'percentage completion' at the side panel. See the screenshot below.
I checked for logs and I get this.
After this error log, I used the below template. Added parenthesis (***).
{{#=}}({{#lookupWorkItems}}{{#filter(status = "Done")}}{{/}}{{size}}{{/}} / {{lookupWorkItems.size}}) * 100{{/}}
Still the %age competition was not displayed in the side panel. In addition to this I am not getting the error logs anymore which is a hint that the rule is not even getting triggered. Here is the latest screenshot of the error log page.
I hope I gave all the required information, but still i anything else is required please let me know and I will share. All I want is - the %age completion should also show in the custom field of side panel.
IMPORTANT NOTE - If I manually enter the %age calculation while creating an epic, I see the value on the side panel.
Hi @HQRAZAHS
As well as looking at the comment from @Jeroen Poismans , you could also consider using .multiply(100) rather than '* 100', and similarly for divide use .divide(lookupIssues.size):
See https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/ for other maths functions
Hello @HQRAZAHS
If your goal is to see the % completion of child issues in a custom field of an Epic, you need to use smart values in the Lookup Issues action in order to retrieve that.
First, use Lookup Issues to get all child issues that are done
then create a variable a = {{lookupIssues.size}}
Second, use Lookup Issues to get all child issues
then create a variable b = {{lookupIssues.size}}
For the Edit Issue action, if your field percentage completion is a numeric field, here is a smart value: {{#=}} ({{a}} / {{b}}) * 100 {{/}}
If it is a text field: {{#=}} ({{a}} / {{b}}) * 100 {{/}}%
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
I might be overlooking something, but before I'm testing further, could it be that your rule is missing a step? You are referencing lookupWorkItems, but I dont' t see the lookup step?
Can you start by confirming this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anyway,
Here is what the lookup should look like:
Also, use the lookupIssues smartvalue when referencing the search result, lookupWorkItems did not work in my example.
Let me know how this goes.
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.