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

GET all the portals where the logged in user is a customer

Laura De Vita April 17, 2024

HI,
we must return, via code, all the portals where the logged in user is a customer.

From what we have seen, the following methods return only the portals and service desks connected to the user as agents.
I tried both the getServiceDesks method of the following interface https://docs.atlassian.com/jira-servicedesk/3.9.1/com/atlassian/servicedesk/api/ServiceDeskService.html
that the method
getPortalForServiceDesk of the following interface
https://docs.atlassian.com/jira-servicedesk/3.9.1/com/atlassian/servicedesk/api/portal/PortalService.html
how can we solve this by returning only the portals where the user has access as a customer?

2 answers

0 votes
Laura De Vita April 18, 2024

Hi,

I would like to retrieve the information with a rest api or with using an interface method?

 

 

Best Regards,

Laura

0 votes
waqas Wilan2026 April 17, 2024

To fetch all the portals where the logged-in user is a customer, you'll need to access your database or backend system where user and portal data is stored. The exact method for retrieving this information will depend on your specific system architecture and database schema.

Here's a general outline of how you might approach this:

1. **Authentication**: Ensure that the user is logged in and authenticated in your system.

2. **User Identification**: Identify the logged-in user, typically through a unique identifier like a user ID or email address.

3. **Query Portals**: Query your database or backend system to find all portals where the logged-in user is associated as a customer. This might involve querying a table that stores user-portal relationships or a table specifically for customers.

4. **Retrieve Portal Data**: Fetch additional information about each portal if needed, such as portal name, URL, or other relevant details.

5. **Return Data**: Format the retrieved portal data in a way that suits your application's needs, such as JSON, XML, or any other format required by your frontend.

6. **Handle Errors**: Implement error handling in case there are issues with the database query or if the user is not found.

Without more context on your specific system architecture and database structure, it's challenging to provide more specific guidance. If you can provide more details, I can offer more tailored assistance!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events