Jira Module

Hi,
this is my first post. I am beginner in PowerShell and either programming.
I have a task to build a PS tool to revoke Jira licenses (Server, not Cloud) of inactive users depending of days since their last login and send mail notification to project leaders of projects where these revoked users were assigned.
Using SQL and API I get all information which I need:

  • inactive users,
  • users’s projects,
  • project leaders and their mails
    But I can’t link these all lists, arrays, objects and add to this some logic to build complete solution.
    Which control flows, conditional statements comes to your mind in this case? Any help would be appreciated.

There are already some pre-build Jira Powershell Modules, have you looked at them?

Yes, I know this module. I even use in my script to kick-off user from group :slight_smile: As I said I have all data to get this thing done.
I need solution to second part. Having all this information I don’t know how to:

  • link mail notification to project leaders, by list of revoked users.
  1. user john.doe was inactive for more than 30 days
  2. he was assigned to Foo project
  3. Foo project leader is jane.doe
  4. send e-mail to jane.doe that john's license was revoked and he is member of your Foo project
User can be assigned in more than one project. Each project leader should receive that mail.

That is specific question to the Jira community rather than a Powershell question, so if you have not you may want to find a forum dedicated to the JiraPS module. As far as how to relating data, I would find a Project that John Smith is assigned to typically and get the data for both (Project + User) to see how the application is linking objects. There is a published schema that shows you how data is linked in the database, but the API may be providing information differently:

https://developer.atlassian.com/server/jira/platform/database-schema/

Take a look at the data model:

https://developer.atlassian.com/server/jira/platform/database-schema/

It will explain how data is joined in the database.

Take a look at the schema:

https://developer.atlassian.com/server/jira/platform/database-schema/