I am using the Service Desk API https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/ where I first create a customer https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/customer-createCustomer
Then I add that customer to a service desk https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/servicedesk/{serviceDeskId}/customer-addCustomers
I can see that the portal customer gets created but I get an error when i add the customer to the service desk which says that the customer cannot be found. If I close my application and just run the add customer function again everything works fine but I need to be able to do this in the same thread of I will have to build a more complex solution.
Yesterday I experimented with doing this using the same Rest Client and it worked but today it stopped working again and I have to revert to thinking about my more complex solution.
What I am building is an Azure Function that will receive a post from a form on one of our websites and then create the customer, add the customer to a service desk and then create a customer request. Since I get an error when adding the customer to the service desk in the same call I will have to think about using Azure Durable Functions to split up this task into several Azure Functions and pass data between them based on what message the customer entered in the original form.
This seems to me as some sort of cache based bug in the Service Desk API and would be good to get some feedback on before I start building the more complex solution as a workaround.