java - How to get User Input to Populate Jira Fields -


i new java , using jira misc custom fields add-on , require logic assistance solve math functions between 2 drop down fields.

field 1 "user cost" field contains 4 string selections user price posted @ end of string.

  1. sam costs .21
  2. mitch costs .419
  3. lance costs 2.66
  4. xmen costs 13.338

field 2 "usage" field contains 2 string selections:

  1. 24 hours (unless maintenance)
  2. 12 hours (7a-7p)

the argument should invoked new field called "total user cost." field automatically display correct price user , usage amount.

the equation blueprint follows:

cost*31(calendar days)*usage(12 || 24) 

i want form update based on user input selection of these 2 fields , other variables in equation.

this have far:

[instance]

usage

thank in advance feedback!

if understand correctly, first need initialize issue something. (it looks red in images variable doesn't exist)

then, can

double costsam = 0.21; string usersam = issue.get("customfield_10620"); 

then, if needing convert or otherwise math on usersam, need this

double samtotal = costsam * double.parsedouble(usersam); 

some flaws code

  1. you have define types values string or double.
  2. if have string x = "hello" on 1 line, x = 0.4 on next, won't work because of incompatible types
  3. if did have compatible types on consecutive lines, first line pointless unless using value first, second line overwrites value of first one

Comments

Popular posts from this blog

php - isset function not working properly -

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -