Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,285
Community Members
 
Community Events
176
Community Groups

Jira Cloud - Scriptrunner to add users to a group

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?

Thanks :)

1 answer

1 vote
Brant Schroeder Community Leader Dec 15, 2022

@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.

There is also the problem that Jira Cloud does not actually handle users and groups.  It's done by either site admin, or Atlassian Access, which are both separate systems to Jira.

Like Aaron Geister likes this

Thanks @Nic Brough -Adaptavist- for the insight. I now have a better idea of the issue at hand. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events