I don't have much experience with scripting so I want to ask if anyone has set up ScriptRunner automation rule for removing users from an organization or can recommend some approach.
Hi @Brad Butchers ,
would you please provide more information? What is your situation and why and under which circumstances do you need to do such a thing?
Hello,
We need this too. We have added the whole organization twice: with ".com" and ".net"Now we should remove all users with ".com". Is this possible to do with script or somehow?
We use Cloud.
Thanks,Max
Hi Hana,
The situation is if people leave a company they can complete a certain request type and it will automatically remove them from the organization
Cheers
Brad
Sorry if this is wrong topic. I have done my task via REST API. I created VBScript and deleted unused users (3600).
you can send DELETE request to the Service Management's API. Even though it is experimental, it worked for me, I just needed to provide additional header:
X-ExperimentalApi: opt-in
It is not clear from the documentation, but you need to provide list of usernames, which you want to remove from the organization. So the request body is the same as when you are adding users to the organization, something like:
{"usernames": ["username1","username2","username3" ] }
Example of how to send request can be found here.
Excellent thanks, what would the script look like thought? I'm new to the groovy/java scripting for script runner but i did run these through postman and they work for me too.
For an automation rue to work firstly I would need to know how to get the username from a custom field to use as the user to remove. How would I do this?
Second would be to get the organization that user belongs too. How would I do this too?
Anyone else able to help me to change the script from logged in user to a specific account?
It looks like you're new here. Sign in or register to get started.