Creating Service Desk tickets for new users via REST API

I’m working on an app that connects to JIRA using the REST API to create Service Desk tickets. I’ve run into a weird issue though. When I add new users to both the “jira-users” and “service-desk-users” groups, they still can’t create tickets in the Service Desk project when I try to do it through the API.

I think it might be because these users haven’t accessed the system through the “Portal Access” security level yet. Has anyone figured out how to handle this through the API? Or maybe there’s a better way to create Service Desk tickets for users who haven’t logged into the portal yet?

I experienced a similar challenge while implementing a ticketing system. It’s crucial to ensure the user is properly registered as a Service Desk customer before ticket creation. The Service Desk API has specific endpoints for customer management, notably POST /rest/servicedeskapi/servicedesk/{serviceDeskId}/customer, which you must utilize to register users explicitly. This step replicates the initial portal access required for ticket creation. After registration, you can seamlessly create tickets using regular API calls without issues. It’s an essential process that often gets overlooked.

You’re definitely on the right track about the portal access requirement. I ran into this exact same problem about six months ago when building an integration for our helpdesk. The issue is that JIRA Service Desk maintains a separate customer registry that doesn’t automatically sync with your user groups. What worked for me was using the customer invitation endpoint first. You need to call /rest/servicedeskapi/servicedesk/{serviceDeskId}/customer with the user’s email address to essentially “invite” them to the service desk. This creates the necessary customer record without requiring them to manually access the portal. Once that’s done, you can create tickets on their behalf using the standard ticket creation endpoint. The key is making sure you reference them properly in the ticket payload using their customer key rather than their username. This approach has been working reliably for our automated ticket creation workflow.

totally feel ya on this! ran into the same mess before. to get it working, you gotta use the customer endpoint first, or jira doesn’t recognize them. even if they’re in groups, they need to be registered as customers. after that, ticket creation goes smooth!