Forums

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

Automation for a special calculation

Thorsten Otto October 16, 2025

Hi together, I^m new in Jira. And I want to do a special calculation.

My starting point is: I have 9 global evaluation fields, and I want to do a math operation for these 9 fields.

And now comes the tricky part. When I can only evaluate 4 of these 9 fields with 5 stars, the total should be 100% when the others are empty becouse I can`t evaluate them. Also when I have only 3 of the 9 or 7 of the 9 fields.

I have created a automation for this, but it will not work. 

I have my 9 evaluation field, and 1 field where the resulkt should be stored. This field is a Number field.

Now in the Audit-Log i see that the automation is working, but it could not write the output to the number field.

Automation:

Trigger: Value ChangeFields  > Evaluation field 1-9

Then: Edit Process fields 

SmartValuse:

{{#=}}
(
{{issue.customfield_20012|0}} +
{{issue.customfield_20013|0}} +
{{issue.customfield_20014|0}} +
{{issue.customfield_20015|0}} +
{{issue.customfield_20016|0}} +
{{issue.customfield_20017|0}} +
{{issue.customfield_20018|0}} +
{{issue.customfield_20019|0}} +
{{issue.customfield_20020|0}}
)
/
(
{{#if(issue.customfield_20012)}}1{{else}}0{{/}} +
{{#if(issue.customfield_20013)}}1{{else}}0{{/}} +
{{#if(issue.customfield_20014)}}1{{else}}0{{/}} +
{{#if(issue.customfield_20015)}}1{{else}}0{{/}} +
{{#if(issue.customfield_20016)}}1{{else}}0{{/}} +
{{#if(issue.customfield_20017)}}1{{else}}0{{/}} +
{{#if(issue.customfield_20018)}}1{{else}}0{{/}} +
{{#if(issue.customfield_20019)}}1{{else}}0{{/}} +
{{#if(issue.customfield_20020)}}1{{else}}0{{/}}
)
{{/}}

 

Output should be witten to my Number Output field.

 

But my Jira every Time say:

The operation was successfully processed, but some of the specified fields are not available. 
Ignored fields: Formula test thot (customfield_12044)

The field is there, i can manualy write numbers in it, but it still won`t work. Maybe im to silly to do that, or maybe it`s not possible to do that.

 

1 answer

2 votes
Christos Markoulatos
Community Champion
October 16, 2025

Hey @Thorsten Otto  👋 Welcome to Jira

That audit message usually means the rule actor can’t edit that field for that issue, or the field isn’t available on the project’s Edit/Create screen or in the field’s context.

First do this checks:

  • Make sure the rule actor (often “Automation for Jira”) has permission to edit the issue. If you use an Issue Security scheme, add the role atlassian-addons-project-access to the security level so the automation actor can see/edit the issue.
  • Confirm the Number field you’re updating is on the Edit screen for that issue type and that the field’s context includes this project/issue type.

How to calculate “percentage of filled ratings”

From what you described, you want 100% whenever all filled ratings are 5 stars, regardless of how many are filled. That’s:

percentage = (sum of filled ratings) ÷ (count of filled ratings × 5) × 100

You can do this with a single smart value using math expressions ({{#=}}…{{/}}) and IF() to count only the filled ones. I’d also guard against divide‑by‑zero and round the result.

Replace the IDs with yours:

{{#=}}
/* sum of ratings */
S = {{issue.customfield_20012.asNumber|0}} +
{{issue.customfield_20013.asNumber|0}} +
{{issue.customfield_20014.asNumber|0}} +
{{issue.customfield_20015.asNumber|0}} +
{{issue.customfield_20016.asNumber|0}} +
{{issue.customfield_20017.asNumber|0}} +
{{issue.customfield_20018.asNumber|0}} +
{{issue.customfield_20019.asNumber|0}} +
{{issue.customfield_20020.asNumber|0}};

/* count only the fields you actually evaluated (assuming stars are 1–5) */
C = IF({{issue.customfield_20012.asNumber|0}} > 0,1,0) +
IF({{issue.customfield_20013.asNumber|0}} > 0,1,0) +
IF({{issue.customfield_20014.asNumber|0}} > 0,1,0) +
IF({{issue.customfield_20015.asNumber|0}} > 0,1,0) +
IF({{issue.customfield_20016.asNumber|0}} > 0,1,0) +
IF({{issue.customfield_20017.asNumber|0}} > 0,1,0) +
IF({{issue.customfield_20018.asNumber|0}} > 0,1,0) +
IF({{issue.customfield_20019.asNumber|0}} > 0,1,0) +
IF({{issue.customfield_20020.asNumber|0}} > 0,1,0);

/* avoid divide-by-zero; scale to % and round */
IF(C = 0, 0, ROUND((S / (C * 5)) * 100, 0))
{{/}}

  • Put that directly in the Edit issue → your Number field (not JSON).
  • The asNumber|0 / |0 defaulting avoids errors when a field is empty.
  • ROUND(..., 0) returns a whole number; change to 1 if you want one decimal place.

Trigger

Use “Field value changed” on your 9 rating fields, then Edit issue to set your output field with the expression above. That’s all.

If it still shows “ignored fields,” switch the rule actor to Automation for Jira (or yourself for a test) and re-run; if it works then, it’s a permissions/screen/context issue as noted.

Links that might help:

Let me know if it worked

 

Thorsten Otto October 16, 2025

Hi, sorry i forgott to say that this is a calculation in Jira Product Discovery. I learned that Jira and Jira Product Discovery have not the same options in automations.

Christos Markoulatos
Community Champion
October 17, 2025

Hey again @Thorsten Otto 

In JPD, most idea fields can only be edited by Creators (the paid JPD role). The default Automation for Jira actor often doesn’t have JPD Creator permissions, so attempts to set JPD fields will succeed “overall” but ignore the specific field updates, producing the audit message you saw.

Try the below:

  1. Run the rule as a Creator
    In the rule Details → Actor, select “Run as” a specific user who is a JPD Creator (e.g., yourself), and re‑test if it works is the permission.
  2.  “Automation for Jira”
    To use the system actor, Atlassian Support can (case‑by‑case) grant it the right JPD access. As far as I remember you have to open a ticket to Support “adding the Automation user to JPD”

The rest of the solution should work I believe

Thorsten Otto October 17, 2025

Hi Christos, my Role is Administrator, should be ok to do that.

For my Understanding. The Automation should look like this?

 

Trigger>If changes on the Fields 1-9 > Action > do the calculation > Action > writ to field where I want the Data inside

Or have I do a Automation, where alle 9 Fields need an action with variable and SmartValue?

Christos Markoulatos
Community Champion
October 17, 2025

I believe for the calculation, you don’t need nine separate actions, just one rule:
Trigger: Field value changed on your 9 rating fields → Action: Edit work item → paste this smart value in your Number field:

{{#=}}
S = {{issue.customfield_20012.asNumber|0}} + … + {{issue.customfield_20020.asNumber|0}};
C = IF({{issue.customfield_20012.asNumber|0}} > 0,1,0) + … + IF({{issue.customfield_20020.asNumber|0}} > 0,1,0);
IF(C = 0, 0, ROUND((S / (C * 5)) * 100, 0))
{{/}}

This calculates (sum ÷ (count × 5)) × 100 and rounds to a whole number.

Thorsten Otto October 17, 2025

Sadly I become this

Unknown operator ; at character position 38: S = 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0; C = IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0); IF(C = 0, 0, ROUND((S / (C * 5)) * 100, 0))

Christos Markoulatos
Community Champion
October 17, 2025

try this:

{{#=}}
ROUND(
  IF(
    (
      IF({{issue.customfield_20012.asNumber|0}} > 0, 1, 0) +
      IF({{issue.customfield_20013.asNumber|0}} > 0, 1, 0) +
      IF({{issue.customfield_20014.asNumber|0}} > 0, 1, 0) +
      IF({{issue.customfield_20015.asNumber|0}} > 0, 1, 0) +
      IF({{issue.customfield_20016.asNumber|0}} > 0, 1, 0) +
      IF({{issue.customfield_20017.asNumber|0}} > 0, 1, 0) +
      IF({{issue.customfield_20018.asNumber|0}} > 0, 1, 0) +
      IF({{issue.customfield_20019.asNumber|0}} > 0, 1, 0) +
      IF({{issue.customfield_20020.asNumber|0}} > 0, 1, 0)
    ) = 0,
    0,
    (
      (
        {{issue.customfield_20012.asNumber|0}} +
        {{issue.customfield_20013.asNumber|0}} +
        {{issue.customfield_20014.asNumber|0}} +
        {{issue.customfield_20015.asNumber|0}} +
        {{issue.customfield_20016.asNumber|0}} +
        {{issue.customfield_20017.asNumber|0}} +
        {{issue.customfield_20018.asNumber|0}} +
        {{issue.customfield_20019.asNumber|0}} +
        {{issue.customfield_20020.asNumber|0}}
      )
      /
      (
        (
          IF({{issue.customfield_20012.asNumber|0}} > 0, 1, 0) +
          IF({{issue.customfield_20013.asNumber|0}} > 0, 1, 0) +
          IF({{issue.customfield_20014.asNumber|0}} > 0, 1, 0) +
          IF({{issue.customfield_20015.asNumber|0}} > 0, 1, 0) +
          IF({{issue.customfield_20016.asNumber|0}} > 0, 1, 0) +
          IF({{issue.customfield_20017.asNumber|0}} > 0, 1, 0) +
          IF({{issue.customfield_20018.asNumber|0}} > 0, 1, 0) +
          IF({{issue.customfield_20019.asNumber|0}} > 0, 1, 0) +
          IF({{issue.customfield_20020.asNumber|0}} > 0, 1, 0)
        ) * 5
      )
    ) * 100
  ),
  0
)
{{/}}
``
Thorsten Otto October 17, 2025

I removed the ; becouse they are not valid, but still get these:

Too many numbers or variables: S = 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 C = IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) + IF(0 > 0,1,0) IF(C = 0, 0, ROUND((S / (C * 5)) * 100, 0))

Thorsten Otto October 17, 2025

He could not change the value to a number.

Could not convert the field value to a number. Please ensure that the value is a number, a mathematical expression, or a smart value that can be converted to a number.
Formula test thot: 0 ``

Thorsten Otto October 17, 2025

So Automation now runs with Success. But the Value isn`t 100% its 0

I have now selectet all fields with 5 Stars, but get only 0 as Value, should be 100. 

But it works, thank you for your effort to help me.

Suggest an answer

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

Atlassian Community Events