Remote user and group management
Let's now have a look at the user and group management using remote APIs. This is really useful when the users and groups need to be managed from a third-party application.
As opposed to the previous recipes, this one uses SOAP methods because user and group management is not yet available via REST.
Getting ready
Create a SOAP client as mentioned in the Creating a SOAP client recipe.
How to do it...
Creating a group and user are pretty straightforward. The following is how we do it once the client is created:
//Create group jtricks-test-group RemoteGroup group = jiraSoapService.createGroup(authToken, "jtricks-test-group", null); //Create user jtricks-test-user RemoteUser user = jiraSoapService.createUser(authToken, "jtricks-test-user", "password", "Test User", "support@j-tricks.com");
Here, the first snippet creates a group with the name jtricks-test-group
. The third argument is RemoteUser
which can be added to the group as the first user when the group is created...