I wrote the following code:
-------------------------------------------------------------------------------------------------------------------------------------
Object PackageNumber = issue.getCustomFieldValue(cfm.getCustomFieldObjectByName("Package Number"));
String partsCol[] = PackageNumber.toString().split(".");
System.out.println(partsCol[0]);
-------------------------------------------------------------------------------------------------------------------------------------
Here I'm getting the error to access partsCol[0]
I got the solution with little modification
String partsCol[] = PackageNumber.toString().split(".");
is changed to
String partsCol[] = PackageNumber.toString().split("\\.");
At a guess, I'd say your custom field value does not have any . in it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Nic,
the custom field value contains "." in it.
But java split do not considering the "." as a regular expression,instead I tried using escape sequence as "\\." and I got it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh, well done. I keep forgetting split uses regex - it would have been splitting on everything...
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.