attach Child Ticket Web Service

Hello,

I am attempting to create a workflow that has automation that when a major incident (sev 1 for us) is created, a workflow will use web services to create a parent problem ticket.  

I see the below article how how to create a child ticket but i want to do the opposite, 

https://solutions.teamdynamix.com/TDClient/1965/Portal/KB/ArticleDet?ID=18914

 

here is my body script and it generates a problem ticket with all the right info but it isnt attaching the child original ticket, can someone help me?

 

{
"TypeID":3271,
"FormID":6744,
"Title":"{{OrigTicketTitle}}",
"Description":"{{OrigTicketDesc}}",
"Classification":33,
"Prim Resp":"{{OrigTicketPrimResp}}",
"AccountID":6603,
"childrenID":"{{OrigTicketID}}",
"SourceID":291,
"StatusID":2683,
"PriorityID":921,
"RequestorUID":"5a0ebd2c-ce32-ed11-ae83-dc98401d7b89"
}

 

 

Asked by Alex Turek on Fri 2/17/23 1:03 PM Last edited Fri 2/17/23 1:03 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Fri 2/17/23 1:33 PM

Hello Alex,

Creating a ticket doesn't have a property for defining child ticket IDs, but there is an endpoint that allows for adding child ticket IDs to a parent ticket, so maybe you could use the response body of the parent ticket creation in a 2nd web method call to POST https://YourDomainHere/TDWebApi/api/{appId}/tickets/{id}/children and provide the current child ticket's ID in an array in the call's body to add it to the parent ticket, which you'll get its ID from the response body of the previous web method.

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback
Hey Mark,

Can you help walk me through that second web method? In the first web method I choose in the workflow store response body and called it "responsebodyticket". In the second web method i have one parameter :ID, STring, From Workflow, ResponseBodyTicket:ID. Is that all I need or what else do I need to do in the body to get this to complete?
- Alex Turek Fri 2/17/23 2:03 PM
I believe you would reference it by using responsebodyticket.ID as the property's source value from workflow. So with a period separating them and not a colon. - Mark Sayers Fri 2/17/23 2:12 PM
I am getting a 404: Sorry, the content you requested could not be found. Please verify that the routing parameters you have provided are properly-typed.

I have it callingup in parameters the ticket.ID and nothing in the body, is that how that post works for children? Or did I miss a step?
- Alex Turek Fri 2/17/23 2:37 PM
It expects a "body" to consist of an array of child ticket IDs, and that should be where you reference the parameter for the ID of the child ticket. - Mark Sayers Fri 2/17/23 2:40 PM
I think i am getting stuck, here is the script and it is getting a 404 error still:
POST https://festfoods.teamdynamix.com/TDWebApi/api/293/tickets/{id}/children content-type: application/json {
"childTicketIds":"1023210"
}
- Alex Turek Fri 2/17/23 2:46 PM
An array in JSON is denoted by the [ and ] brackets, not the mustache {} brackets. That could be part of it.

Also, if that {id} in your URL is meant to be referencing a parameter from your Parameters tab, you need to encase it in double mustache brackets like {{id}} (and it is case sensitive to the name of the parameter you created).
- Mark Sayers Fri 2/17/23 2:53 PM
Got it to work thank you!! - Alex Turek Fri 2/17/23 3:03 PM
You're welcome! - Mark Sayers Fri 2/17/23 3:10 PM