Yes, the shooting was related to the event.
It was a “draw Mohammed” art contest, to protest the Charlie Hebdo censorship as well as deliberate contrast to a rally “for the prophet Mohammed” held there by thousands of Muslims a few weeks before.
The event was organized by Pamella Geller and like-minded people. It was known that there was a danger, hence six cordons of security at the event.
The gun men showed up at 7 PM, when the event was supposed to end but ended up lasting a little while longer. The gunmen were confronted by security, hence the officer down and two dead gunmen.
Muslims tried to kill people drawing Mohammed or enjoying the art show, arriving at a location (parking lot) and time to kill people as they were leaving.
It sounds like the organizers of the event were ready for this. Good idea, actually. Smoke them out.