Forums

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

How get value from text field?

daymonTwo February 8, 2020 edited

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 edited

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 Champion
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
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events