简体   繁体   中英

Automate JIRA user creation using Groovy Script

We are continuously receiving user creation/removal in our JIRA instance as the team is growing.

I am looking for possible options to automate this using groovy script.

Currently, we are having a separate project in JIRA handling these requests. Team will raise the tickets with user name, required roles & Manager will be approve request in the project and then it will be picked by JIRA admin to create/remove the users.

Then JIRA admin will close the ticket.

I am looking to automate the JIRA admin work, Once the ticket is raised by team & moved to a certain status(like Approval), JIRA should create the users automatically. How this can be achieved using groovy script?

Thank you.

You should be able to use the Jira API to do what you want. The Jira REST API Reference has everything you need.

For user creation, a POST request to the rest/api/3/user endpoint should work while a DELETE request to the same endpoint should remove the user. This guide by Atlassian has detailed information on creating users via that endpoint.

The REST API reference also has endpoints to automatically transition the state of the Jira issue. A GET request to the /rest/api/3/issue/{issueIdOrKey}/transitions endpoint shows you all possible transitions for an issue while a POST request to the same endpiont allows you to transition the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM