Workflow not attached when ticket created via API

Hello, we have a service with a linked workflow that gets set correctly when creating a ticket in TDNext or through the service page.  However, the workflow is not attached correctly when we create a ticket through an API.

Any ideas why an API-generated ticket would not attach the workflow?

Thanks, Tevis

Asked by Tevis Boulware on Mon 8/15/22 1:58 PM
Sign In to leave feedback or contribute an answer

Answers (3)

This answer has been marked as the accepted answer
Mark Sayers Tue 8/16/22 9:51 AM

Hello Tevis,

Are you utilizing the WorkflowID property when you create your tickets via API to ensure there is a workflow being specified for these tickets?

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback
I am not the author of the API calls, but I will check to see if they are setting the workflow ID.

However, I had thought that if a workflow was "hardcoded" into the service settings, the workflow would be attached on ticket creation. Is this not the case?

Thanks, Tevis
- Tevis Boulware Tue 8/16/22 10:32 AM
It should work if the service specifies it, is my understanding. If that is not the case I'll want you to document that the service does show as having a workflow configured, and that a valid Requestor is being specified on these tickets, and submit that all as a support ticket so we can investigate. - Mark Sayers Tue 8/16/22 1:54 PM

Scott Cory Wed 9/18/24 11:16 AM

Thanks Mark,

We do not want to have a Service in the Client Portal for this since we want this ticket creation to only be possible using the API. Is it possible to create a hidden or inactive service that would still function with the API? This is the reson I went with the subsequent PUT endpoint to add the workflow after the ticket is created by the API which is working for the time being.

No feedback
You could make the service in question restricted to only members of a certain group, though you'd need the user you're making the API call with to be a member of that group.

Otherwise just doing the subsequent PUT call would be the only other way to add the workflow to the created ticket.
- Mark Sayers Wed 9/18/24 12:11 PM

Scott Cory Tue 9/17/24 2:44 PM Last edited Tue 9/17/24 5:01 PM

Hi Mark,

I am using this in the JSON body and the workflow is not being added to the ticket created by POST to the API endpoint:    

{

   ...,

   "WorkflowID": 1234567,

   ...

}

Any idea why?

No feedback
Also included "WorkflowName" and still no luck. The only way I could get a workflow assigned is to use a subsequent PUT https://mysupport.domain.com/TDWebApi/api/{appId}/tickets/{id}/workflow?newWorkflowId={newWorkflowId}&allowRemoveExisting={allowRemoveExisting} - Scott Cory Tue 9/17/24 5:04 PM
It appears my initial response to that question was off-base. The association with a Service that is configured to apply a workflow is what adds that on the ticket creation. So, configure a service to apply a workflow to tickets using the service, then reference that service when you create the ticket via API and that will also cause the workflow to be applied on creation. - Mark Sayers Wed 9/18/24 10:00 AM