Need help with broken rule - triggeringItem in OH3?

Hello experts,

I copied a template of rules out of this forum here regarding irrigation system (YAWS, yet another watering solution).

This year (after migration to OH 3) one of my rules aren´t working anymore. As far as I can say it´s because of the last line in this code (triggeringItem). I was reading that there were some changes with this triggeringItem but I do not know how to fix it in the end.
As the code is not by me I don´t even know what the triggeringItem was used for.

Can you please help me out to get my rule back running again?
Thank you!

rule "Irrigation - valve updated, turn on the timer"
	Item GroupIrrigationValves changed or 
	Item Test_Switch changed

	// protection against overwatering
	// log the state of all valves
	GroupIrrigationValves.members.forEach [valve | 
		logDebug("Irrigation", "Irrigation valve: " + + " " + valve.state)

	// a valve was turned on
	if (GroupIrrigationValves.state == ON) {
		if (IrrigationTimerMax.state == OFF) {
			// timer is not set yet, start the timer
			logDebug("Irrigation", "Irrigation valve open, starting protection timer")
		else {
			// the timer is already running
			logDebug("Irrigation", "Irrigation valve open, timer already started, nothing to do")
	else {
		logDebug("Irrigation", "All irrigation valves closed, stopping protection timer")

And here´s the log entry when the rule fails:

2022-05-20 17:55:43.171 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'beregnungsanlage-6' failed: cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.items.Item.getState() on null in beregnungsanlage

In OH 3 triggeringItem only exists for rule triggered with a Member of trigger. For all other Item triggered rules there is triggeringItemName. You can replace that last line with

postUpdate(triggeringItemName, newState.toString())

However, that last line doesn’t make a whole lot of sense in the first place. Why update the Item to the same state that the Item has already changed to?

Thank you so much - my rule is running again.