How do I create listener to events like new user, new project in java not as part of plugin ?
Can it run on Jira onDemand also ?
You don't, mostly. Only issues and versions really fire events, although the list is growing.
For writing them, see https://developer.atlassian.com/display/JIRADEV/Writing+JIRA+Event+Listeners+with+the+atlassian-event+Library
And, no, you can't install add-ons into OnDemand.
It looks like you're new here. Sign in or register to get started.