Web Service Methods, Date Field Parameter for Second Ticket

I am working on a work flow that will create tickets based off of information in the original ticket. One of the fields that i would like to be brought over to the new tickets from the original ticket is the "Employee Start Date". However when I run the flow with the parameter and body as defined below The workflow fails at the webservice ticket creation step. If i remove the Date parameter from the body, and from the defined parameters list, I am able to execute the workflow with the missing field.

The parameter is defined as follows:

Name = StartDate, Data Type = Date, Source = From ticket, Source Property = Employee Start Date 

The Body is defined as follows:

{
"TypeID":1635,
"FormID":8277,
"Title":"New Employee needs Shared Email and Okta Tile Assignment {{StartDate}}",
"Description":"Created from ticket {{OrigTicketID}}",
"AccountID":{{AcctDeptID}},
"SourceID":134,
"StatusID":1271,
"PriorityID":471,
"RequestorUID":"{{RequestorUID}}",
"Attributes":
  [
    { "Name": "New Employee Name", "ID": 18624, "Value": "{{NewEmpName}}" },
    { "Name": "Skidmore Email Address", "ID": 18623, "Value": "{{SkidEmail}}" },
    { "Name": "Employee Start Date", "ID": 18621, "Value": "{{StartDate}}" },
  ] 
}

Is there a problem with how I have defined the date field within the parameters? or is it an issue with the body text?

Tags webservice workflows Date method parameter
Asked by Irene Muller on Tue 7/9/24 10:41 AM Last edited Tue 7/9/24 10:43 AM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Tue 7/9/24 11:51 AM

Hello Irene,

What is the error you are encountering when you try to run this call currently?

Sincerely,
Mark Sayers
Sr Support Consultant, CS

1 of 1 users found this helpful.
When I run the call on it's own I don't fill out the Date field because I'm not sure the formatting for Date Fields. - Irene Muller Tue 7/9/24 1:53 PM
So you have never tried in in a "live" workflow then? - Mark Sayers Tue 7/9/24 2:09 PM
Yes. When I try it in a "live" workflow the web service method fails. The workflow then notifies me of the failure. If I remove the parameter and associated body information, the Web service method succeeds. - Irene Muller Tue 7/9/24 2:12 PM
Ok, when you use a datefield as a parameter, the value it supplies for that also *includes* quotation marks around the date value. So it would confuse the call by inserting unnecessary quotes around that value in the Title and in that custom attribute.

For the custom attribute part of the call, try removing the quotation marks entirely from around the parameter for the start date there.

For the Title, try switching the quotes around the title's value to single quotes.
- Mark Sayers Tue 7/9/24 2:21 PM
I tried the following for the body:

{
"TypeID":1635,
"FormID":8277,
"Title":'New Employee needs Shared Email and Okta Tile Assignment {{StartDate}}',
"Description":"Created from ticket {{OrigTicketID}}",
"AccountID":{{AcctDeptID}},
"SourceID":134,
"StatusID":1271,
"PriorityID":471,
"RequestorUID":"{{RequestorUID}}",
"Attributes":
[
{ "Name": "New Employee Name", "ID": 18624, "Value": "{{NewEmpName}}" },
{ "Name": "Skidmore Email Address", "ID": 18623, "Value": "{{SkidEmail}}" },
{ "Name": "Employee Start Date", "ID": 18621, "Value": {{StartDate}} },
]
}

It came back as a Failure
- Irene Muller Tue 7/9/24 2:34 PM
What was the failure error message exactly? - Mark Sayers Tue 7/9/24 2:58 PM
The Error Message I got is a task step with a predetermined message set by the workflow detecting a failure. Is there able to extract the specific web method error from the workflow? - Irene Muller Tue 7/9/24 4:12 PM
What is the URL of your web service method call? - Mark Sayers Tue 7/9/24 4:16 PM
https://skidmore.teamdynamix.com/SBTDAdmin/49EA080B-7B27-4D85-91CD-AA04B8CB58B7/154/WebServiceMethods/Index/#/478/edit - Irene Muller Tue 7/9/24 4:17 PM
That appears to probably be the location of the web service method in your TDAdmin environment. What is the URL that the method is specifically pointed at (which API endpoint is it using? provide the URL of the API endpoint for the method) - Mark Sayers Tue 7/9/24 4:47 PM
It looks like the one i was testing with did not have the correct URL for the web method. After correcting this and implementing the parenthetical changes recommended, the method succeeded. Thank you for your help. - Irene Muller Wed 7/10/24 8:31 AM