You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hey there 👋,
I want to use ScriptRunner, to add around 500 users to a certain group.
I found a couple of tips from other users, but they all relate to Jira server
How do I do this in Cloud?
@Alexander Ziegltrum Welcome to the Atlassian community
Adaptavist answered this in a different community post and the answer still stands true today. https://community.atlassian.com/t5/Jira-Software-questions/How-to-add-users-to-a-JIRA-group-with-Scriptrunner-Cloud/qaq-p/1302299
"I can confirm that it is not possible with ScriptRunner for Jira Cloud to set users as members of groups.
The reason for this is that the Add User to Group which Atlassian provide as documented here is marked as Apps cannot access this REST resource.
This means that ScriptRunner for Jira Cloud will be unable to make a call to this Rest API as it is only permitted to use the API's which Atlassian allow Apps to access."
@Brant Schroeder thanks for picking up my topic and for your quick answer :)
I have checked out the linked post, which is almost 2 years old. Meanwhile I got this answer from one of the Adaptavist techs. As I understand, it should be possible by now:
I can confirm that you will be able to add users to one group calling the following REST API call[ here|https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-groups/#api-rest-api-3-group-user-post] . Please, keep attention to the permissions required to run the previous API call , the user who call the script have to be a member of "site-admin" and you will need to generate an API Token to use an authentication mode when you call the function. I mean:
// where the email of one member of site-admin , and the password is the API Tokendef result = post("/rest/api/3/group/user") .header('Content-Type', 'application/json') .basicAuth('user','passw')
Unfortunately, I do not have the necessary programming skills to work it out by myself, I have to find a different (GDPR supporting) solution.
So I have asked Atlassian & Adaptavist to try and get something moving to make this work without all the overhead.
For security purposes is probably why they haven't released a fix for this but it is weird that you can do it from the outside via API but not from app add-on or from a native answer like Automation for Jira.
I did find away to do this but you will have to use some engineering and you have to use an IPAAS system. I used BetterCloud to do this from our JSM requests. It is a lot to set up but it does work.
I would much rather this be an ability that Scriptrunner and or Automation for Jira can handle.
The other thing is to get an IDP that is able to use SCIM which is the best way and we are migrating our groups from Atlassian directory to SCIM to help mitigate this issue.
Best of luck.