Greetings!
I'm pretty new to this whole Scriptrunner thing, so I'm looking for some help with a scripted field. I'm looking for a script, which would allow me to divide a variable value on a static one and show a result as a percentage.
I'm going to use two custom fields for a variable value and a result of this equation.
Something like this:
N (variable) / 40 = Z%
What do you mean that you will use two custom fields for a variable value? one value can be used for one field or there is something else?
Basically your script would look like this
import com.atlassian.jira.component.ComponentAccessor
def cs = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("customfieldname");
return issue.getCustomFieldValue(cs)/150
Morning!
Well, I'm talking about configuring two separate fields: a field for user's value and a field to show a result.
Right now, with your script (thanks for that!), it looks like this:
http://prntscr.com/i5sb9n
The result, I'm looking for:
http://prntscr.com/i5se8j
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then you need to create a scripted field with a script like this
import com.atlassian.jira.component.ComponentAccessor
def cs = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("customfieldname");
return issue.getCustomFieldValue(cs)/40*100
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.