How get value from text field?

daymonTwo February 8, 2020

Hi, i want get value from text field and set value in other field but in log i see error 

2020-02-08 21:57:22,402 http-8080-5 ERROR admin 1377x821x1 ljf71i 127.0.0.1 /rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json [onresolve.jira.groovy.BehaviourManagerImpl] Something went wrong with method run in class
java.lang.NumberFormatException: For input string: "MYF-1"  

This is my code 

def cutomField=getFieldById("customfield_10000");
String value=(String)cutomField.getValue();
def sum=getFieldById("summary");
sum.setFormValue(value);

maybe someone write how get rid of this error. Thanks

Version my jira 5.0.3

 

 

3 answers

1 accepted

0 votes
Answer accepted
daymonTwo February 9, 2020

If I write this, then everything works fine

def cutomField=getFieldById("customfield_10000");
String value=(String)cutomField.getFormValue();
def sum=getFieldById("summary");
sum.setFormValue(value);
0 votes
Kaushik Veluru
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.
February 8, 2020

Am not sure what fields you are updating. But from the error it shows that the field is supposed to be Number but you are entering a string. 

If "MYF-1" is an issue, get issue ID and use that. 

0 votes
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2020

Dear @daymonTwo ,

it seems that you question is better placed at https://community.developer.atlassian.com/.

Could you be so kind to reopen it there?

So long

Thomas

Suggest an answer

Log in or Sign up to answer