Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation rule is not functioning

HQRAZAHS
Contributor
August 21, 2025

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. 
Rule setup.png

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.

Jira view.png

I checked for logs and I get this.
image (10).png

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.

Audit Logs updated.png

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.

 

4 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2025

Hi @HQRAZAHS 

First thing: what source are you using for the smart value expression you tried for the percentage value?

I ask, as there are many unsupported and incorrect things in that expression.  I recommend not using that source, and instead refer to the documentation from Atlassian for smart values: https://support.atlassian.com/cloud-automation/docs/jira-cloud-automation/

 

Next, to use the {{lookupIssues}} smart value the rule must first use the Lookup Work Items action.  Otherwise, there is no data in the smart value.

And so an example rule to update an Epic custom field Percentage Complete when a child work item transitions status would be this:

  • trigger: work item transitioned
  • condition: issue type is one of Story, Task, Bug (or whatever your child types are)
  • condition: parent field is not empty
  • action: lookup work items, with JQL of
    • parent = {{issue.parent.key}}
  • branch: to parent
    • action: edit work item, setting the Percentage Complete to this smart value expression
{{#=}}ROUND( ( 0{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+1{{/}}{{/}} ) / {{lookupIssues.size|0}} * 100, 0){{/}}

How that works is:

  1. iterate over the child work items
  2. filtering them for ones in a "Done" status category
  3. and adding +1 to the result
  4. with a 0 at the front as a default value
  5. wrapping that in parentheses to create the sum count
  6. dividing that by the total number found (i.e., the size of the list)
  7. multiplying that by 100
  8. rounding to 0 decimal places
  9. finally wrapping all of that in a math expression

That will calculate the percentage by count of items.  When instead one wants the percentage by the Story Point values, this would work:

{{#=}}ROUND( ( 0{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+{{Story points|0}}{{/}}{{/}} ) / {{lookupIssues.Story points.sum|0}} * 100, 0){{/}}

 

Finally, other cases...

Several things could impact the accuracy of the percentage complete.  And thus either one needs to create multiply rules to calculate the value, or use a single rule with a Scheduled Trigger to periodically calculate the value.  Those cases include at least these:

  1. When the child work item of an Epic transitions status, update the Epic's percentage
  2. When a child's Story Points change, ...
  3. When a new child is created and added to an Epic, ...
  4. When an existing child is added to an Epic, ...
  5. When an existing child is removed from an Epic, update the previous parent Epic's field
  6. When a child changes to a new parent, update both Epics
  7. When a child work item is deleted, update the previous parent
  8. When a child work item's type changes, update the Epic(s) when necessary
  9. When someone manually tampers with the percentage in the Epic, recalculate it
  10. When there is an Atlassian outage preventing rules from running, they may not all trigger later.  As a precaution, create a Scheduled Trigger rule which will update all relevant Epics.
  11. etc.

Some of these cases may be combined to reduce the number of rules.

 

Kind regards,
Bill

HQRAZAHS
Contributor
August 21, 2025

@Bill Sheboy Finally I have something in the Percentage Completion custom field in the side panel. I cant thank you enough for this support.. I see the audit logs also and it shows success. See below screenshots.

Audit Logs - Success.png

Jira view success.png

But I do have a question. I notice the expected outcome only for newly created epics. What about the ones which are existing from before? Do I need to do some extra stuff for them?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2025

Earlier I described creating a Scheduled Trigger rule to help when Atlassian has an outage.  That rule may also be used to "catch up" existing Epics:

  • in the trigger, set the JQL to find Epics where that field is empty
  • structure the rule based on the trigger work item being an Epic, finding its child work items with the lookup 
  • enable the rule, and let it run until caught up
  • then disable it again...saving it in case of an Atlassian automation outage

 

0 votes
Stephen_Lugton
Community Champion
August 21, 2025

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):

image.png

 

See https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/ for other maths functions

0 votes
Duc Thang TRAN
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2025

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

  • parentEpic = {{triggerissue}} and statusCategory = done

then create a variable a = {{lookupIssues.size}}

Second, use Lookup Issues to get all child issues

  • parentEpic = {{triggerissue}} 

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 {{/}}%

2025-08-21 11_31_28-Audit log - Automation - Admin Jira - Test - Jira — Mozilla Firefox.png

HQRAZAHS
Contributor
August 21, 2025

@Duc Thang TRAN Is this correct? I still do not see the expected result unfortunately.

Part 1.png

Part 2.png

Part 3.png

HQRAZAHS
Contributor
August 21, 2025

I am gettin this error log @Duc Thang TRAN 

Error Log.png

Duc Thang TRAN
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2025

@HQRAZAHS 

I think your smart value {{triggerworkitem.key}} don't work 

try with {{triggerissue}}

Duc Thang TRAN
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2025

aaaa.png

This part doesn’t make sense.
You trigger on the Epic, but the branch will take action on the parent of this Epic and not on the Epic itself (unless I’m misunderstanding your need).
I think you can delete this branch.

HQRAZAHS
Contributor
August 21, 2025

@Duc Thang TRAN  Can we have a short connect please? I can send you an invite as per your availability. 

HQRAZAHS
Contributor
August 21, 2025

@Duc Thang TRAN I made the correction. Here are the screenshots. But the problem still exists.

Screenshot 1.png

Screenshot 2.png

Screenshot 3.png

Screenshot 4.png

Screenshot 5.png

Screenshot 6.png

 

AUDIT LOG: 
The rule is not getting triggered, don't see any entry.

Audit Log Duc.png

Jira Page.png

 

 

0 votes
Jeroen Poismans
Community Champion
August 21, 2025

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?

Screenshot 2025-08-21 104647.png

Can you start by confirming this?

 

Jeroen Poismans
Community Champion
August 21, 2025

Anyway,

Here is what the lookup should look like:

Screenshot 2025-08-21 105504.png

Also, use the lookupIssues smartvalue when referencing the search result, lookupWorkItems did not work in my example.

Let me know how this goes.

HQRAZAHS
Contributor
August 21, 2025

@Jeroen Poismans I pasted my new setup in my previous response to Duc. Could you please review and advise. I am using lookupIssues this time.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events