While Hamas doesn't seem to have been directly responsible for the rocket attack, it seems likely that they gave the green light to another group to shoot it.
Why?
Because Hamas knows that Israel cannot just ignore the rockets, and will inevitably respond with a minor airstrike towards an empty weapons cache or similar target.
And knowing that, Hamas can test out its shoulder-mounted Strela anti-aircraft missiles.
Hamas spokesman Hazem Qassem announced, “Congratulations to the men of the resistance who confronted the fighter jets with our anti-aircraft defense.” Qassem claimed it had been the first time that Hamas had used the surface-to-air missile.
In January, Gaza groups also fired anti-aircraft missiles at IDF helicopters that responded to "accidental" firing of rockets.
Hamas needs targets to practice using its weapons. What better target than Israeli planes and helicopters? Especially since they can be conjured up at will with a couple of cheap rockets.