creating custom JQL functions

Im trying to pal up with jql functions and write a function to catch the issues with inactive users in some single user picker field. In the internet I've found this code, but cannot figure it out how to use it in my case (not reporter / assignee, but any other field. For example, issueFunction in HasInactiveUser('Manager')

If you really want to roll your own JQL function, you'll want to review the documentation on Custom JQL Functions. In short, you'll need to create the directory path com/onresolve/jira/groovy/jql under one of your script roots on your JIRA server's filesystem (of course, your path will use backslashes if your JIRA server is a Windows machine). Take that code and put it in a HasInactiveAssignee.groovy file.

Also, it looks like your code is missing some imports and a package declaration ( package com.onresolve.jira.groovy.jql ) at the top. Make sure to include those, or the script won't work.

Once that's in place, you'll need to rescan for the new JQL function and you should be able to use it, assuming that code is good and you got all the imports added.

Thank you for your help! We are on an older version now, so I havent seen this function. Need to try

And about custom functions, I have tested this one, it works, but to be honest I'm not a professional in groovy, so cannot find which part of this code can get a custom field, for example as it is in your function

user in InactiveUsers()

or IssueFunction in inactiveUser(customfield)

maybe there is some "create a function" tutorial for very-very new groovy developers? With explaining 'who is who'