i would like to know if there is an common api for fetching users of all Jira products , adding users, fetching billing related information, https://developer.atlassian.com/cloud/ ,I have checked this documentation I cant find specific resource to fetch users , add user and billing related information.
Hi @divya
Welcome to community! You can use the users api to fetch users and add users in your instance. However, regarding billing related information. Are there any specific information you're looking for?
is this "users" common to all JIRA products? and billing related information such as amount , plan name ,bill date, and other licensing related information(expiry ,renewal dates) is needed for fetching through api.
And the mentioned Api returns some unwanted information (different apps as users)along with the users list
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=*******b9320d9ea5bdc2",
"accountId": "*******b9320d9ea5bdc2",
"displayName": "Jira Outlook",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=*********52030f1e3a5905",
"accountId": "*******52030f1e3a5905",
"accountType": "app",
"displayName": "Jira Spreadsheets",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=*******950f9f5b-3d6d-4e1d-954a-21367ae9ac75",
"accountId": "******e9ac75",
"accountType": "app",
"displayName": "Jira Service Management Widget",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=*******:f58131cb-b67d-43c7-b30d-6b58d40bd077",
"accountId": "************3c7-b30d-6b58d40bd077",
"accountType": "app",
"displayName": "Automation for Jira",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=**********b97ab11a18e00c7",
"accountId": "***************8e00c7",
"accountType": "app",
"displayName": "Halp",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=*******:0867a421-a9ee-4659-801a-bc0ee4a4487e",
"accountId": "*******:0867a421-a9ee-4659-801a-bc0ee4a4487e",
"accountType": "app",
"displayName": "Slack",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=*******:214cdd6a-ff93-4d8b-838b-62dfcf1a2a71",
"accountId": "*******:214cdd6a-ff93-4d8b-838b-62dfcf1a2a71",
"accountType": "app",
"displayName": "Trello",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=************c0efbe55103",
"accountId": "************0efbe55103",
"accountType": "app",
"displayName": "Opsgenie Integration",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=*************29c6c47967",
"accountId": "******************c68529c6c47967",
"accountType": "app",
"displayName": "Statuspage for Jira",
"active": true
},
{
"self": "https://*******.atlassian.net/rest/api/3/user?accountId=60****************0682db95d",
"accountId": "6**************db95d",
"accountType": "atlassian",
"displayName": "yello",
"active": true
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, you have to filter the result. Atlassian cloud has 4 different accountType namely:
Knowing the above, you should filter your output to get the desired result. For the information about billing, I'm not sure Atlassian has any public API for those but you can look into this Marketplace vendor API and see how that can help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
while using the user api from my java code using url "https://*****.atlassian.net/rest/api/2/users/search?maxResults=100"
i get some users list but not complete list instead it suffixes the response with "...." like this,
response: self":"https://****a213.atlassian.net/rest/api/2/user?accountId=-45c7-8e5c-ac6635decc67","accountId":"-45c7-8e5c-ac6635decc67","accountType":"atlassian","16x16":"https://secure...."
how to get complete list of users
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @divya
You need to use pagination in your code. You can use the startAt parameter to search record by record. Run a loop and only stop the loop when you reach an empty list like [] from the payload.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as per the resources.. the pagination will return some values such as total, isLast page etc ,but when I try I'm just getting the specified number of users and not the other stuff.
URL I used : https://sitejira213.atlassian.net/rest/api/2/users?startAt=0&maxResults=6
My response : [{user},{user},{user},{user},{user},{user},{user}]
expected response : { "startAt" : 0, "maxResults" : 10, "total": 200, "isLast": false, "values": [ { /* result 0 */ }, { /* result 1 */ }, { /* result 2 */ } ] }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @divya
The API doesn't return the total number of user's available, you can get that from the record count.You can create a function that will produce the desired result you want. The API would just return the user's details only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.