Skip to main content

I want to use workflow automator to get the fields from a not yet created ticket and then use those fields in other workflows.

Example process in worklfow below: 

  1. Service Request raised
  2. condition to check if it is a certain service request.
  3. GET fields from ticket
  4. Parse response body to use to create a change request

If i use the get request on a ticket currently in the queue, it spits out all the fields perfectly

 

If i put in a place holder to catch the next ticket in the queue that matches the condition and event, i get a 404 error.

 

 

 

Does the freshservice GET API allow you to get info from a not yet created ticket? if so, how do I do it because I know I can get information from a ticket already in the queue.

 

@joestract I’m a little confused on what you are trying to do. If you are trying to get service item fields that don’t have answers to them then you would just use the api to get the service item not including a ticket id since no ticket id would be available yet, you can also use a conditional to look up the requested item and then fields within that item.  All these hinge on the fact that a Service Request is raised meaning a ticket has been submitted based on your event trigger.

GET: {{BaseURL}}service_catalog/items/258 ← service item id that you are looking for.

Can you explain what you’re trying to do and maybe I can help you a little better.

 

 


Yup!

  1. event
    • Service Request raised (someone chooses a service item from the catalog and submits a brand-new service request ticket)
  2. condition to check if it is a certain service request.
    • Is this the service item we want to look for and call the API
  3. API Web request to GET fields from this brand new ticket
    • get unique user input details from fields of Step 1s service request.
    • These fields will change based on what the user inputs at time of ticket creation
  4. Parse response body to use to in other tickets
    • use fields from ticket to populate into other areas.
      • add notes to tickets
      • send emails with the field details
      • create new tickets
      • etc.

 

 

for step 3 of the above, i can GET information from tickets already in the ticket queue, but where I am struggling with is getting information from a brand-new ticket and is there a placeholder that will do it?

Basically this API Call:
 

Service Desk API for Developers | Freshservice

 


change ticket.id to {{ticket.id_numeric}}


Yes ​@ITMike - {{ticket.id_numeric}} … another annoying undocumented thing 

 

and if you’re doing a change you have to do a split or trim liquid instead, numeric doesn’t work!


@Roxwell Thanks for the info on the changes, I couldn’t ever get it to work so I used tasks within changes instead.  Just made my life easier!!


@Roxwell is quite right.

 

Just for anyone else struggling to do this with Changes (as we did prior to full rollout), here’s an example that you can use within Change Workflows.

Take the ‘change.id’ (which usually would read as, for example, ‘CHN-123’) and trim the ‘CHN-’ characters via an Expression like so:

This will give you the change numeric id which you can use in follow-up nodes:

 


Do you still have to split it ?  Was building a Change to INC ticket WFA few days Ago and when I used the PH for Change ID I just got the number and not the CHN 

Other way to remove the prefix is to use liquid filter 

{{change.id | remove: 'CHN-'}}