Below is the Python code to get all the users from a group in Jira. You need to install a request library for this. Here is the code:
import requests
from requests.auth import HTTPBasicAuth
import json
url = "https://your jira address here/rest/api/3/group/member"
auth = HTTPBasicAuth("username", "jira token mention here")
headers = {
"Accept": "application/json"
}
query = {
'groupId': '6078c76f-bf47-4573-a150-b9f0285ac8aa'
}
response = requests.request(
"GET",
url,
headers=headers,
params=query,
auth=auth
)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
Comments
Post a Comment