I have a scripted field that works as expected with number fields. How can I modify the inline script to work with a select list field?
def cv1 = getCustomFieldValue(Field1) as Double;
def cv2 = getCustomFieldValue(Field2) as Double;
def cv3 = getCustomFieldValue(Field3) as Double;
return = (cv1 + cv2 + cv3)
Switching to a select list field, the value coming back is not a number. How do I convert it to a number so I can use it in a calculation?
Hello,
If select list is not multiple select list, try below script
Option option1 = (Option) getCustomFieldValue(Field1);
def cv1 = option1.getValue() as Double;
...
Tuncay,
The fields a re single select lists.
When I modify the inline script as you suggested, I get the following
"unable to resolve class Option"
How do I resolve the class?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have aded this to the scripted field:
import com.atlassian.jira.issue.customfields.option
But get the message
"unable to resolve class com.atlassian.jira.issue.customfields.option"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have added this to the inline script:
import com.atlassian.jira.issue.customfields.option;
and now get the message
"unable to resolve class com.atlassian.jira.issue.customfields.option"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For sure, you have to import it.
import com.atlassian.jira.issue.customfields.option.Option;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.