Hi!
I'm having trouble with server-side script in SR Behaviors. Any help would be greatly appreciated.
Requirement:
Local number format:
Code:
def revField = getFieldByName("My numeric CF")
def revFieldCurValue = revField.getValue().toString()
if (!revFieldCurValue.matches("[0-9]*(|[0-9]*,[0-9]{2})") && !revFieldCurValue.matches("[0-9]*(|[0-9]*,[0-9]{1})") && !revFieldCurValue.matches("[0-9]*")) {
log.warn("Fire!")
def revFieldNewValue = revFieldCurValue.replace(" ", "")
revFieldNewValue = revFieldNewValue.replace(".", ",")
revField.setFormValue(Long.valueOf(revFieldNewValue))
}
The problem is that <getValue()> returns "null" in my instance.
Even more frustrating is that "null" returns even if the value is correct, but it has decimals (which separated by comma)!
For example, correct format of value "10000,00" gets null. But "10000" gets "10000.0".
Is there a way to retrieve value initially with transformation from local format to long or to string?
Or may be there is a completely different way to achieve the same thing (requirement-wise)?
Hi @Alex Trebek,
Currently, the format of the Number Field that you are trying to configure is not supported by Jira; hence it's not doable in ScriptRunner.
Please visit this Atlassian Jira Ticket for more information.
Thank you and Kind Regards,
Ram
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.