Calculate hidden fields with JIRA Automation

koutarou ishibashi
Contributor
September 29, 2023

I want to set a number in the hidden item and calculate it with JIRA automation.
Hiding a field results in a Smart Value Rendering Error.

Is it impossible to calculate a hidden field?

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 29, 2023

Hello @koutarou ishibashi 

Per the 2021 answer from Simmo on this post, if your rule is running as the Automation for Jira user then it should be able to access Fields that have been Hidden through the Field Configuration.

https://community.atlassian.com/t5/Jira-Software-questions/Can-Automation-rules-edit-a-hidden-field/qaq-p/1801459

If that does not address your question please show us your automation rule and the output in the Audit Log.

koutarou ishibashi
Contributor
October 1, 2023

If the following calculation hides the item, it will result in an error.
{{#=}}{{issue.customfield_10273}} / {{issue.customfield_10272}} * 100 {{/}}

Unknown unary operator / at character position 1: / * 100

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 1, 2023

The error is not due to trying to set a value on a hidden field. You have syntax errors in your statement that result in Jira not finding the data for the smart values you used.

Your smart values appear to have a blank space between customfield_ and the number that comes next. You need to remove that blank space.

koutarou ishibashi
Contributor
October 2, 2023

There is no space after the customfield_.
customfield_10273, if the customfield_10272 is displayed, there will be no error.
customfield_10273, if you hide the customfield_10272, an error will occur.

Can't hidden fields be calculated?

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.
October 2, 2023

Hi @koutarou ishibashi 

Context is important for automation rules; would you please post images of:

  • your complete automation rule,
  • including where you have that smart value expression, and
  • of the audit log details showing the complete rule execution, with that error?

Those may explain the symptom you are observing.  Thanks!

And as Trudy noted from that linked post: "hidden" fields can only be edited by automation rules when the rule actor is the default value, Automation for Jira.  That user has special permissions allowing it to bypass the screen/field checks for edit.  If you have changed the rule actor then it cannot edit / see the field.

Kind regards,
Bill

Like Trudy Claspill likes this

Suggest an answer

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

Atlassian Community Events