I am trying to create a Jira automation the uses a service account to look up the members of a group via a REST endpoint (i.e., api.atlassian.com /admin/v1/orgs/{ORG_ID}/groups/{GROUP_ID}/members) using the “Send Web Request”
I am receiving the following error when trying to validate the automation: Failed with status: 401
Response: {“code”:401,“message”:“Unauthorized”}, which I believe to be an issue with the scope. I have tried both OAuth bearer and Basic api token access and get the same results/errors.
Can you provide a link to the documentation you are referencing that describes this endpoint you are using and the OAuth 2.0 scopes it requires?
Are you sure you’re not confusing Groups managed at the Organisation level with Groups that are managed within Jira itself, and are managed via Jira’s Groups endpoints?
Also, you said you were using a Send Web Request action in Jira Automation to submit the request. Is it a GET or POST request type?
As I understand it, the service account cannot interact directly with your SITE but is required to go through the api.atlassian.gateway. I would provide an example of how I constructed the URL but new users are limited to 2 URL’s per posting.
In the end, what I am trying to do is have an automation rule create sub tasks for each member of a group and assign it to the user by matching the group name associated to the parent work item from where the automation is triggered. I haven’t been able to find a feature/function in the automation framework to do this natively so I thought that I could try one of two things:
I could try to use the “Send web request” and get the group membership and use this to create the sub-tasks
Maintain this list outside of the automation and have the automation prompt the user to provide the names of users to create the sub-tasks.
That is the endpoint URL you would use to send requests to manage Users in Groups in Jira using a Service Account that uses OAuth with the scopes described in the second piece of documentation.
The endpoint URL you had previously constructed was some sort of “Frankenstein’s monster” of one third OAuth / one third Basic Auth / one third Organizations API endpoint that didn’t exist
If you need more specific information about how to construct Send Request automation actions, the Jira Questions of the public Atlassian Community forum is where that topic is discussed.