# In valueChanged NameError: global name 'project' is not defined

**URL:** <https://forum.inductiveautomation.com/t/in-valuechanged-nameerror-global-name-project-is-not-defined/116142>\
**Category:** Ignition\
**Created:** [June 24, 2026, 10:04pm UTC](https://forum.inductiveautomation.com/t/in-valuechanged-nameerror-global-name-project-is-not-defined/116142 "2026-06-24T22:04:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rigoberto.reyes](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@rigoberto.reyes](https://forum.inductiveautomation.com/u/rigoberto.reyes)\
**Post date:** [June 24, 2026, 10:04pm UTC](https://forum.inductiveautomation.com/t/in-valuechanged-nameerror-global-name-project-is-not-defined/116142/1 "2026-06-24T22:04:47Z")

</div>

I have created a memory tag with next script in ValueEvents/Value Changed:

**def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):**  
project.PruebaCambioStatus.PasodeValores(tagPath, previousValue, currentValue, initialChange)

In Project Library project/PruebaCambioStatus I have next function:

**def PasodeValores(tagPath, previousValue, currentValue, initialChange):**

```python
def PasodeValores(tagPath, previousValue, currentValue, initialChange):

	# Creamos un logger específico para esta tarea
	logger = system.util.getLogger("PruebaCambioStatus")
	
	# Extraemos los valores reales (evitando el objeto calificado completo si solo queremos el valor)
	pre_val = previousValue.value if previousValue is not None else None
	cur_val = currentValue.value if currentValue is not None else None
	
	# Formateamos el mensaje para el log
	mensaje = "Path: {} | PreValue: {} | CurValue: {} | IniChange: {}".format(
	    tagPath, pre_val, cur_val, initialChange
	)
	
	# Publicamos en el log como INFO
	logger.info(mensaje)
	

```

Once memory tag changes value, next error message appears in the log

([default]TurnoFicticio, valueChanged) Error executing tag event script: Traceback (most recent call last): File "tagevent:valueChanged", line 2, in valueChanged NameError: global name 'project' is not defined

How it can be solved?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 24, 2026, 10:06pm UTC](https://forum.inductiveautomation.com/t/in-valuechanged-nameerror-global-name-project-is-not-defined/116142/2 "2026-06-24T22:06:39Z")

</div>

> **[Gateway Scripting Project​ - Project Library | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/platform/scripting/scripting-in-ignition/project-library#gateway-scripting-project)**
>
> Scripts under the Project Library are a project-based resource that allows user created Python scripts to be configured. Objects and functions created in a Project Library script can be called from anywhere in the project. Project Library scripts are...
