I want to write post-functions in create issue and want to know from script runner where the jira ticket is created .ie from email or web.
Is it possible?
No.
By the time script runner is invoked, I guess, that information is lost, AFAIK.
Write your own email handler or use JEMH which can fill in a custom field which differentiates the tickets.
Are there any good tutorials on how to start writing my own email handler.
This is your starting point - https://developer.atlassian.com/display/JIRADEV/Custom+Message+(Mail)+Handler+for+JIRA
I would suggest that you look at JEMH before spending time to develop an own handler. at https://marketplace.atlassian.com/plugins/com.javahollic.jira.jemh-ui
It looks like you're new here. Sign in or register to get started.