CA Service Management

Expand all | Collapse all

text_api - set Requester = Log Agent via email

Jump to Best Answer
  • 1.  text_api - set Requester = Log Agent via email

    Posted 10-21-2016 11:35 PM

    SDM 14.1.03

     

    When creating a Request via email, the Reported By (log_agent) and Affected End User (customer) are set automatically to the sender of the email.

     

    We have the requirement that the Requested By (requester) field also be this value automatically without the having to use %REQUESTER= in the body of the email.

     

    I have tried setting a default data partition of requested_by=log_agent.  This is accepted in the constraint but has no affect.  I've also played with setting REQUEST.REQUESTER=%LOG_AGENT in the text_api defaults just for grins.  It had no affected but didn't produce an error, either

     

    Does anyone know where this is processed that I can see if it can be modified?

     

    thanks,

     

    J.W.



  • 2.  Re: text_api - set Requester = Log Agent via email

    Posted 10-22-2016 01:28 AM

    If you can't set this via data partition or text api configuration it can be accomplished through a post_ci trigger. Let me know if you would like an example, it can be configured to only fire from tickets created via the text app. I'm not sure if there's a simpler way to do this..  



  • 3.  Re: text_api - set Requester = Log Agent via email

    Posted 10-22-2016 12:51 PM

    gbruneau

     

    Thanks, I think I can research triggers to test but an example would always be helpful. 

     

    If we are not going to make the field required then I am also working on an Event to check on Initial and if the Requested By is null then set it to the Reported By - this will take care of all interfaces - and I can then remove the hidden field on the Employee form as well, I believe.

     

    J.W.



  • 4.  Re: text_api - set Requester = Log Agent via email

    Posted 10-22-2016 01:24 PM

    Hi J_W,

     

    That makes sense, here's an example using a trigger and spel.  I didn't test but I think it should work.  This trigger/spel sets Requested By to Reported By only when created via the email interface.

     

    Contents of mod file

    MODIFY CR POST_CI zSetRequester(persistent_id, log_agent) 11111 FILTER (created_via {->"EMAIL"} && (EVENT("INSERT")))


    Contents of spl file

    cr::zSetRequester(...)
    {
    string method;
    method = "cr::zSetRequester";

    string     persistent_id;
    uuid     log_agent;

    persistent_id      = argv[3];
    log_agent      = argv[6];

    send_wait(0, top_object(), "call_attr", "api", "update_object_super", log_agent, persistent_id, 0, "requested_by", log_agent); 
    }

    Edit: Just updated the sendwait command, I forgot to update one variable.



  • 5.  Re: text_api - set Requester = Log Agent via email
    Best Answer

    Posted 10-24-2016 04:23 PM

    Grant,

     

    I ended up going the Event route as it will be easier for the customer to maintain.  There will not be a lot of tickets via email to begin, so I don't think there will be a performance issue.

     

    J.W.



  • 6.  Re: text_api - set Requester = Log Agent via email

    Posted 10-24-2016 11:55 PM

    Good idea, thanks likely the safer and more supportable way to do it.