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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
As it is written in the JIRA rest api documentation, the following script should retrieve all the instance JIRA users:
def result = get("/rest/api/3/users/")
To get it working, the documention says that the runner should have JIRA global permission "Browse users and groups" granted. The group in which the user belongs is jira-administrator, which has this permission.
However, when I run the script, I got a 403 error. If I add the "public" group to the "Browse user and groups" permission, it works fine. If a run the script as the scriptrunner addon user, I also get a 403.
I do not know if it is a JIRA/Scriptrunner integration problem , or just a JIRA rest api bug, so I submit this request to you hoping that someone can tell me more about this.
Thank you for your question.
I can confirm that the Get all users default Rest API which you are calling in your script as documented here is marked as Apps cannot access this REST resource.
This means that ScriptRunner for Jira Cloud is unable to call it and is why you are getting forbidden response when you make a rest API call to it as Atlassian imposes that ScriptRunner for Jira Cloud can only access the public rest API's which they mark as allowed to be used by Apps.
This means this is not a bug but is just a limitation of Jira Cloud where Atlassian mark this API as not allowed to be used by Plugins inside of Jira Cloud.
I hope this information helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.