Typed Variable Declaration Error

Error encountered for the a similar formula below

2014-08-19 08:21:31,083 http-bio-8080-exec-14 ERROR USER1234 501x95052x2 1b6xxqy 202.167.233.229,10.241.12.70 /browse/HRT-2273 [innovalog.jmcf.fields.CalculatedTextField] CalculatedTextField: error evaluating formula: Sourced file: inline evaluation of: `` Object CG1 = issue.get("customfield_10800").iterator().next().getName().sub . . . '' : Typed variable declaration

<!-- @@Formula:

Object CG1 = issue.get("customfield_A").iterator().next().getName().substring(7,13);

Object CG2 = issue.get("customfield_B");

if ((issue.get("customfield_A")==null || issue.get("customfield_A").size() == 0) && (issue.get("customfield_B")==null)) return null;

if ("ABCDEF".equals(CG1)||"GHIJKL".equals(CG2)) return "YES";

if ("GHIJKL".equals(CG1)||"GHIJKL".equals(CG2)) return "NO";

return "Unavailable";

-->

I'm getting results except when customfield_A is blank. It gives back nothing.

customfield_A is a multi-group field.

customfield_B is a pick-list field

2 answers

1 accepted

This widget could not be displayed.

I found the solution. I recoded it a bit and made sure the NULL CHECKS come first.

Please, check comment bellow

This widget could not be displayed.

I have the same problem, what do you mean with "made sure the NULL CHECKS come first."? Thank you

You need to check if the custom field you have is BLANK or NULL before proceeding to the other conditions. Sorry for replying late.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

106 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you