Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

am using Automation for JIRA to run a script when the value of a numeric custom field changes and f

Hello,

I am using Automation for JIRA to run a script when the value of a numeric custom field changes and for this, I am referring to the page https://scriptrunner.adaptavist.com/6.16.0/jira/plugins/automation-for-jira.html#_smart_values and section -

The changed field value is available anywhere smart values are supported using the {{fieldChange}} substitution. Use {{fieldChange.fromString}} and {{fieldChange.toString}} to access display values and {{fieldChange.from}} and {{fieldChange.to}} to access raw values (for a select field for example).

{{fieldChange}} only contains the first changed value. If multiple values are changed (e.g. when setting multiple Fix Versions) then you can iterate over these using the {{#changelog.fixVersion}}{{toString}}{{/changelog.fixVersion}} expression.

 

 

This does not work for my number field and I keep getting this error-  "

[c.o.scriptrunner.automation.ExecuteScriptIssueActionV2] Script function failed on Automation for Jira rule: Final script for FNBIPL Pillar - Updated, file: <inline script>, error: java.lang.NumberFormatException: For input string: "1.1"
java.lang.NumberFormatException: For input string: "1.1""

 

I am using the below lines of code-

 

def originalValue = ruleContext.renderSmartValues("{{fieldChange.from}}")
def currentValue = ruleContext.renderSmartValues("{{fieldChange.to}}") 

 

Can someone advise me on how I can fix this? I even tried {{fieldChange.from}} and 

{{fieldChange.to}} but it did not help

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

🤺 Atlympic Event: Partnerships

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

145 views 2 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you