Hello..
I'm trying to figure out if there is a way that one could run a script on a periodic basis that could run a select SQL that would produce a list of JIRA users that haven't logged on in say 60 days. One thing that is a concern about such a script is protecting the JIRA database password so that it isn't clear text within the script. I've got a bit of an idea on the SQL select but am a little unsure on the script workings.
Thanks..
Jimmy, Have you seen this page?: https://confluence.atlassian.com/jirakb/how-to-get-a-list-of-active-users-counting-towards-the-jira-application-license-278695452.html It doesn't include the #days inactive, but could move you toward your goal.
You don't say what sort of script you are talking about, and protecting the database password depends on what you have available. Are you running the script from within Jira in a tool like Scriptrunner? Running a script at the Operating System Command line, or another approach?
Doug...
I've seen that page and other similar queries and have tested a query that shows me a list of inactive users in a period like 60 days. I was unaware of the JIRA tool Scriptrunner and might have to look at that tool. I was leaning toward running a shell script from the Linux server but am concerned about how to protect the database password in that script.
Thanks for the feedback.
We've been testing a trial of ScriptRunner and I recently ran across this link -
https://scriptrunner.adaptavist.com/latest/jira/recipes/misc/connecting-to-databases.html
I took the script mentioned in the above link that connects to the JIRA database and added some of my own SQL to it.. When I try to run it from the ScriptRunner Script Console I get an error like the following -
[Static type checking] - No such property : pname for class: java.lang.Object @ line 25, column 17
Anyone have any ideas on how to correct that error? Or am I trying to do something with the JIRA DB that I shouldn't be doing?
Jimmy,
The Scriptrunner static type checker is a helper. It's telling you that you didn't declare the object the pname property is used on as a type which has a pname property. Based on the java.lang.object type, you likely didn't declare a type at all. Since this is Groovy, types are optional, except that they will cause the static type checker to be confused.
Did you try ignoring the type checker error and running the script? This can often work since type declarations are optional in Groovy.
It looks like you're new here. Sign in or register to get started.