I've added an HipChat postfunction handler on the create transition and, in order to filter out no-bug issues I've added a JQL condition of the type «issuetype=Bug».
What I get is a notification in HipChat that claims that an error occurred.
I've tried also to move the postfunction on the All --> TODO transition but this transition seems not be triggered on a «create» event even if the issue has been created and put in state of TODO.
Regards
RESOLUTION
As David Maye suggested, I've moved down the handler below the 'Create Issue' and 'Indexing? tasks… JQL now can work properly on the entity.