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.htmlthat the methodgetPortalForServiceDesk of the following interfacehttps://docs.atlassian.com/jira-servicedesk/3.9.1/com/atlassian/servicedesk/api/portal/PortalService.htmlhow can we solve this by returning only the portals where the user has access as a customer?
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!
Hi,
I would like to retrieve the information with a rest api or with using an interface method?
Best Regards,
Laura
It looks like you're new here. Sign in or register to get started.