Skip to main content

Hello :)

I have a strange case. I need the mail of the agent who add a time-entry, and also the mail of his reporting manager, too. So, I have a workflow which looks as:

  1. Get ticket agent(who did the action) ID with API
  2. JSON Parser of step 1, and safe the mail of the agent, and the id of the agent(step 1) manager
  3. Get the manager ID(of step 2)
  4. Get manager mail by API(of step 3)
  5. JSON Parser of the manager mail(of step 4)
  6. Send email to both(step 2-agent mail), and (step 5-manager mail).

Unfortunately, I dont know why, it sends 2mails to the agent, and only 1-the right to the manager.

By agent, I mean the person who did the action over the ticket(in my case-add time entry), and I want to get his manager to.

Is it works by default this way? I want 2 different mails to be sent to 2 different people.

Thanks!

Actually, I have noticed, the APIs are the same, like the second API rewrites the first one. So in the end, I have 2 APIs, but the same variables. I try to get from the1st API the ID of the reporting manager stored in a new variable in the JSON parser object. So in the 2nd API, I use that variable for a new API for agents: api/v2/agents/ManagerID

 

Is it a problem if I use 2 times get Agent data API: api/v2/agents/ID?

I dont know why it works that way.

ManagerID - stored variable from the 1st API


Hi @manovades 

could you please share some screenshots and API calls with the responses + parsers? It’s hard to follow your explanation without seeing the workflow overview or the nodes. 

Best regards
Daniel


@DanielRuff You are a God, my dear :D

 

I am so stupid, in the 2nd API JSON Parser, I invoke again the body of the 1st API request….

Thank you, thank you, thank you! :)


Hello @manovades, you should be able to reference the results of each api call by referencing the correct JSON Parser results node. One way to make sure you are getting the values you are looking for is to test by having the workflow add a note to the ticket with the values it gets form the Parser placeholders you choose. This will help you validate it is using the correct email in your action nodes.

Hope that helps!


@zachary.king actually, that is what i did the second time. Thank you, this is the best tip for testing APIs in a workflow.