# Cannot set property 'value' on null object

**URL:** https://community.exalate.com/t/cannot-set-property-value-on-null-object/4741
**Category:** General Questions
**Tags:** exalate, migrated\_question
**Created:** [November 4, 2024, 7:20am UTC](https://community.exalate.com/t/cannot-set-property-value-on-null-object/4741 "2024-11-04T07:20:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)
#### Post date: [November 4, 2024, 7:20am UTC](https://community.exalate.com/t/cannot-set-property-value-on-null-object/4741/1 "2024-11-04T07:20:38Z")

</div>

_Originally asked by Vimalraj Rangasamy on 18 June 2021 [(original question)](https://oldcommunity.exalate.com/questions/30048582)_

* * *

I have setup hybrid sync between 2 projects within a jira instance and get following error.

NullPointerException: Cannot set property ‘value’ on null object

Showing error in the script but does not point to which line

Below is the script,

OEM.issue.customFields.“OEM Affected Programs”.value = “Alexandra”  
[//OEM.issue.customFields](https://OEM.issue.customFields).“OEM Customer Severity”.value = “S2-Severe”

DAR.issue.customFields.“Platform Common”.value = “No”  
DAR.issue.customFields.“Translation Impacts”.value = “No”  
DAR.issue.customFields.“Affects PLQA Tests”.value = “No”  
DAR.issue.customFields.“Affected PLQA Tests are tested earlier”.value = “No”  
DAR.issue.customFields.“Triage Pattern”.value = “No”  
DAR.issue.customFields.“Is a Regression”.value = “Unknown”  
DAR.issue.customFields.“Recovery”.value = “Other”  
DAR.issue.customFields.“Feature”.value = “Other”

I have added script at the end of the field mapping.

* * *

---

<div class="post-metadata">

### Author: ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)
#### Post date: [November 4, 2024, 7:20am UTC](https://community.exalate.com/t/cannot-set-property-value-on-null-object/4741/2 "2024-11-04T07:20:39Z")

</div>

_Answer by Francis Martens (Exalate) on 18 June 2021_

One of the customfields don’t exist.  
To avoid the nullpointer, you can use the [groovy safe navigation operator](https://groovy-lang.org/operators.html#_safe_navigation_operator)  
DAR.issue.customFields.“Bogus”?.value will not result in a nullpointer (check the ?)

To locate the custom field - make sure that all fields exist

* * *
