Skip to main content

Hello,

 

Got a question,

 

So I have a Custom user field called region where it links to the users Company Name on Entra.

 

Is there a way to have a dropdown box for incidents that will look at the users profile to see what region they are in and assign the region from the users profile to the ticket field.

You would have to do it via automation workflow after the ticket is created.  You have to premake the field in the incidents allow it to be submitted blank then run the automation afterwards.  You may be able to do it via an action, but most likely an API call in the automator.

 


Hello,

 

I have tried this and got it working to a certain degree the workflow i have is set up like below

Ticket is raised >

Web Request Get “https://domain.freshservice.com/api/v2/requesters/{{ticket.requester.id}}” >

Copy output and pasted this into the parse >

Web Request Put “https://domain.freshservice.com/api/v2/tickets/{{ticket.id}}

body:{
  "ticket": {
    "custom_fields": {
      "lf_testauto": "{{P1.root.requesters.requesters_object.location_id}}"
    }
  }
}

 

this does work when i put in the test params but when i try to activate it runs the workflow but doesn't apply to the ticket field 

 


Hello,

 

I have tried this and got it working to a certain degree the workflow i have is set up like below

Ticket is raised >

Web Request Get “https://domain.freshservice.com/api/v2/requesters/{{ticket.requester.id}}” >

Copy output and pasted this into the parse >

Web Request Put “https://domain.freshservice.com/api/v2/tickets/{{ticket.id}}

body:{
  "ticket": {
    "custom_fields": {
      "lf_testauto": "{{P1.root.requesters.requesters_object.location_id}}"
    }
  }
}

 

this does work when i put in the test params but when i try to activate it runs the workflow but doesn't apply to the ticket field 

 

 

you have to use the {{ticket.id_numeric}} placeholder. {{ticket.id}} does the whole ID, like SR-1234 


Hello,

 

I have tried this and got it working to a certain degree the workflow i have is set up like below

Ticket is raised >

Web Request Get “https://domain.freshservice.com/api/v2/requesters/{{ticket.requester.id}}” >

Copy output and pasted this into the parse >

Web Request Put “https://domain.freshservice.com/api/v2/tickets/{{ticket.id}}

body:{
  "ticket": {
    "custom_fields": {
      "lf_testauto": "{{P1.root.requesters.requesters_object.location_id}}"
    }
  }
}

 

this does work when i put in the test params but when i try to activate it runs the workflow but doesn't apply to the ticket field 

 

 

you have to use the {{ticket.id_numeric}} placeholder. {{ticket.id}} does the whole ID, like SR-1234 

 

I Tried this an got 200 - success now however its not seeing the value from the parse response as the request body turns to this {
  "ticket": {
    "custom_fields": {
      "lf_testauto": ""
    }
  }
}

 


So after some troubleshooting with the workflow the get request is picking up the correct details but when passing though the parse it doesn’t get keep the details which is why the put web request is coming out as null value.


Hello,

 

Got this fixed, 

 

The way I had to set up was,

 

  1. event - when a ticket is created
  2. condition - If the requester field Location is not empty
  3. web request - (get https://domain.freshservice.com/api/v2/requesters/{{ticket_requester.id}}
  4. generate the output of a single user
  5. parse - single user output from the GET request
  6. web request - put https://domain.freshservice.com/api/v2/tickets/{{ticket.id_numeric}}?bypass_mandatory=true
  7. have the body of the request as

{
  "custom_fields": {
    "lf_testauto": "{{P1.root.requester.location_id}}"
  }
}

 

  1. activate the workflow and test

***Notes***

this does not work when you the workflow is disabled as the PUT workflow will only work with live data and not doing the test web request on the configuration page.