Cannot get property 'value' on null object

Originally asked by PATRICIA FRANCEZI on 14 March 2020 (original question)


I followed the KB

https://docs.idalko.com/exalate/display/ED/How+to+synchronize+tasks+and+subtasks

I have sync the parent issue before the subtasks as requested to in the kb

Got this error:

Cannot get property 'value' on null object. Error line: Script212.groovy:12  
  
Just remembering that I didnt change anything on Script212.groovy  
Jira Server side is in 7.12 version  
Exalate is in version 4.6.0-j7  
  
Putting this information because I´m not authorized to upgrade anything if no evidence is provided.

Comments:

Francis Martens (Exalate) commented on 14 March 2020
  • Is it the incoming or outgoing processor
    (Check Error Type)
  • Can you provide the corresponding processor - especially line 12 …

Answer by Juan Grases on 14 March 2020

Hi!

The error is claiming that you cannot get property “value” from a null object (this is happening in line 12 of either you incoming or outgoing script). What this means is that in that line you are doing

${expression}.value

On something that is empty. The reason of why the expression is empty depends of the expression it self but in many cases it is because

  • You expect something from the other side (replica variable) to be there but it was not received
  • You are trying to access the value of a local custom field but you are using the wrong name

An easy solution would be to replace it with:

${expression}?.value

Which would allow the empty (check groovy docs for more details). Still you might want to analyse why the expression is coming null

Best regards,

Juan


Comments:

PATRICIA FRANCEZI commented on 14 March 2020

Understood the problem.

The outgoing is sending story points, wich is not available for Sub-tasks.

The line is issue.customFields.“Story Points”.value = replica.customFields.“Story Points”.value

i have comment this line and the subtask was created, but the problem is:

  • If Story Points in a Story is updated? How can i have this updated, without having problems with Subtasks using the KB code only?

Question 2: how can I automate the substask sync after sync the parent?

Juan Grases commented on 15 March 2020

You could do:

issue.customFields."Story Points"?.value = replica.customFields."Story Points"?.value


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.