We've Moved!
Please note that we have moved to our New Forum site.

How can i update a terminated interaction in UCS using PSDK modifying the StrAttribute field/column?
Hi,
How can i update a terminated interaction in UCS using PSDK modifying the StrAttribute field/column?
I'm using PSDK 8.5 to manage closed and stored interactions in UCS DB.
We have custom attributes stored on StrAttributeN columns.
We should update a value stored in StrAttribute3 column but with the RequestUpdateInteraction request we can't update StrAttribute fields.
The only mandatory attribute for this request is
com.genesyslab.platform.contacts.protocol.contactserver.InteractionAttributes
but with this object seems not possible to set custom fields.
Thanks
How can i update a terminated interaction in UCS using PSDK modifying the StrAttribute field/column?
I'm using PSDK 8.5 to manage closed and stored interactions in UCS DB.
We have custom attributes stored on StrAttributeN columns.
We should update a value stored in StrAttribute3 column but with the RequestUpdateInteraction request we can't update StrAttribute fields.
The only mandatory attribute for this request is
com.genesyslab.platform.contacts.protocol.contactserver.InteractionAttributes
but with this object seems not possible to set custom fields.
Thanks
For example in my environment StrAttribute3 has a name of 'survey_answer_Overall' and a Display Name of 'Survey Overall'. So I use the Name 'survey_answer_Overall' instead of StrAttribute3
String now = DateTime.Now.ToString();
RequestGetInteractionContent reqGet = RequestGetInteractionContent.Create();
reqGet.InteractionId = "0375MP2M0S5D802E";
EventGetInteractionContent content = ucsProtocol.Request(reqGet) as EventGetInteractionContent;
Debug.WriteLine(content);
if (content.InteractionAttributes.AllAttributes.ContainsKey("survey_answer_Overall"))
{
Debug.WriteLine("survey_answer_Overall = " + content.InteractionAttributes.AllAttributes.GetAsString("survey_answer_Overall"));
content.InteractionAttributes.AllAttributes.Remove("survey_answer_Overall");
}
KeyValueCollection kvc = content.InteractionAttributes.AllAttributes;
kvc.Add("survey_answer_Overall", now);
content.InteractionAttributes.AllAttributes = kvc;
RequestUpdateInteraction req = RequestUpdateInteraction.Create();
req.InteractionAttributes = content.InteractionAttributes;
IMessage res = ucsProtocol.Request(req);
Debug.WriteLine(res);
All Answers
For example in my environment StrAttribute3 has a name of 'survey_answer_Overall' and a Display Name of 'Survey Overall'. So I use the Name 'survey_answer_Overall' instead of StrAttribute3
String now = DateTime.Now.ToString();
RequestGetInteractionContent reqGet = RequestGetInteractionContent.Create();
reqGet.InteractionId = "0375MP2M0S5D802E";
EventGetInteractionContent content = ucsProtocol.Request(reqGet) as EventGetInteractionContent;
Debug.WriteLine(content);
if (content.InteractionAttributes.AllAttributes.ContainsKey("survey_answer_Overall"))
{
Debug.WriteLine("survey_answer_Overall = " + content.InteractionAttributes.AllAttributes.GetAsString("survey_answer_Overall"));
content.InteractionAttributes.AllAttributes.Remove("survey_answer_Overall");
}
KeyValueCollection kvc = content.InteractionAttributes.AllAttributes;
kvc.Add("survey_answer_Overall", now);
content.InteractionAttributes.AllAttributes = kvc;
RequestUpdateInteraction req = RequestUpdateInteraction.Create();
req.InteractionAttributes = content.InteractionAttributes;
IMessage res = ucsProtocol.Request(req);
Debug.WriteLine(res);
the answer you posted is correct and works fine.
I've tried the code you wrote adapted at our scenario and now we can update interaction and custom attributes successfully.
Thank you very much.