Welcome to the Axosoft Community, Sign in | Register | Help
in Search

IncidentHandler.AddIncident() method changed from 2007 to 2008 SDK

Last post 03-11-2008, 4:12 PM by Dennis Allen. 6 replies.
Sort Posts: Previous Next
  •  12-06-2007, 6:49 AM 14270

    IncidentHandler.AddIncident() method changed from 2007 to 2008 SDK

    The signature of the AddIncident method changed from the 2007 SDK to the 2008 SDK, eliminating the custom fields parameter.  How can I set my custom fields in the new SDK?

     In 2007, there were 3 parameters, the security token, the incident, and a customfieldvalue object.  I used this field to display the customer contact submitting the incident report into the incident report via a custom field in my incident template

    From the object browser,  in an OnTime 2007 SDK Sample:    
                      IncidentHandler.AddIncident(System.Guid, Incidents.Incident, Incidents.CustomFieldValue[])

    In the 2008 SDK, the custom field value parameter is missing, and I can't find any way to set my custom fields

    From the 2008 SDK object browser in my application (that was working just fine in 2007):  
                     IncidentService.IncidentHandler.AddIncident(System.Guid, IncidentService.Incident)

    Filed under: ,
  •  12-06-2007, 7:28 AM 14271 in reply to 14270

    Re: IncidentHandler.AddIncident() method changed from 2007 to 2008 SDK

    It looks like the intent was to just use the custom field values from the incident object directly. This is more convenient for updates than adds, becuause you have a 'fully populated' CustomFieldValues object. I think you can just fetch any incident record (just need to do this once) and use it's CustomFieldValues as a template for new ones that you create.

    But there seems to be some problems with add & update web services in 2008, I cannot get any of them to work (even with the new api's that don't have the custom field values as the third param)

    Any time I try an update, I get the following:

    SoapException: Server was unable to process request. ---> Procedure or function spU_DefectCustomFields has too many arguments specified.
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at OnTime.DefectService.DefectHandler.UpdateDefect(Guid securityToken, Defect defect) in C:\Documents and Settings\cprinos\My Documents\Visual Studio 2005\Projects\OnTime\OnTime2008\Web References\DefectService\Reference.cs:line 245

     

    also, looking at the response from the web service asmx pages, it seems like some fields (and all custom fields) are just missing: For this is the one for  https://OnTimeServer/OnTime2008sdk/IncidentService.asmx?op=AddIncident (the same thing in 2007 shows all custom fields):


    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <AddIncident xmlns="http://axosoft.com/ontime/webservices/">
    <securityToken>guid</securityToken>
    <incident>
    <IncidentId>int</IncidentId>
    <CreatedDateTime>dateTime</CreatedDateTime>
    <LastUpdatedDateTime>dateTime</LastUpdatedDateTime>
    <IncidentNumber>string</IncidentNumber>
    <Description>string</Description>
    <ReplicationProcedures>string</ReplicationProcedures>
    <Resolution>string</Resolution>
    <Notes>string</Notes>
    <StatusTypeId>int</StatusTypeId>
    <SeverityTypeId>int</SeverityTypeId>
    <ReportedDate>dateTime</ReportedDate>
    <StartDate>dateTime</StartDate>
    <CompletionDate>dateTime</CompletionDate>
    <PercentComplete>unsignedByte</PercentComplete>
    <EscalationLevelId>int</EscalationLevelId>
    </incident>
    </AddIncident>
    </soap:Body>
    </soap:Envelope>

     

  •  12-06-2007, 7:34 AM 14272 in reply to 14271

    Re: IncidentHandler.AddIncident() method changed from 2007 to 2008 SDK

    I can't seem to edit my previous response... but here's what the IncidentService.asmx response looks like from a 2007 db set up with the same custom fields (note that they all show up in the xml compared to what 2008 returns)(

     

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <AddIncident xmlns="http://axosoft.com/ontime/webservices/">
    <securityToken>guid</securityToken>
    <incident>
    <IncidentId>int</IncidentId>
    <CreatedDateTime>dateTime</CreatedDateTime>
    <CreatedById>int</CreatedById>
    <LastUpdatedDateTime>dateTime</LastUpdatedDateTime>
    <LastUpdatedById>int</LastUpdatedById>
    <LastUpdated>base64Binary</LastUpdated>
    <IncidentNumber>string</IncidentNumber>
    <Name>string</Name>
    <Description>string</Description>
    <ReplicationProcedures>string</ReplicationProcedures>
    <Resolution>string</Resolution>
    <Notes>string</Notes>
    <PriorityTypeId>int</PriorityTypeId>
    <StatusTypeId>int</StatusTypeId>
    <SeverityTypeId>int</SeverityTypeId>
    <ProjectId>int</ProjectId>
    <ReportedById>int</ReportedById>
    <AssignedToId>int</AssignedToId>
    <WorkflowStepId>int</WorkflowStepId>
    <PubliclyViewable>boolean</PubliclyViewable>
    <ReportedByCustomerContactId>int</ReportedByCustomerContactId>
    <ReportedDate>dateTime</ReportedDate>
    <StartDate>dateTime</StartDate>
    <DueDate>dateTime</DueDate>
    <CompletionDate>dateTime</CompletionDate>
    <ActualDuration>float</ActualDuration>
    <ActualUnitTypeId>int</ActualUnitTypeId>
    <EstimatedDuration>float</EstimatedDuration>
    <DurationUnitTypeId>int</DurationUnitTypeId>
    <PercentComplete>unsignedByte</PercentComplete>
    <EscalationLevelId>int</EscalationLevelId>
    <Archived>boolean</Archived>
    <HasAttachments>boolean</HasAttachments>
    <HasRelatedItems>boolean</HasRelatedItems>
    <HasNotifications>boolean</HasNotifications>
    <HasWorkLog>boolean</HasWorkLog>
    <HasEmails>boolean</HasEmails>
    <HasAlerts>boolean</HasAlerts>
    <CustomFieldValues>
    <CustomFieldValue>
    <CustomField xsi:nil="true" />
    <Value />
    </CustomFieldValue>
    <CustomFieldValue>
    <CustomField xsi:nil="true" />
    <Value />
    </CustomFieldValue>
    </CustomFieldValues>
    </incident>
    <customValues>
    <CustomFieldValue>
    <CustomField>
    <CustomFieldId>int</CustomFieldId>
    <TableFieldName>string</TableFieldName>
    <FieldType>Double or String or DateTime or PickList or Text or Boolean or Hyperlink</FieldType>
    <RecordType>Defect or Feature or Task or Incident or WorkLog</RecordType>
    <FieldLabel>string</FieldLabel>
    <PickListId>int</PickListId>
    <StringSize>int</StringSize>
    <Format>string</Format>
    <DisplayOrder>int</DisplayOrder>
    <IsMultiSelect>boolean</IsMultiSelect>
    <IsEditable>boolean</IsEditable>
    <IsCustomField>boolean</IsCustomField>
    <IsGroupable>boolean</IsGroupable>
    <IsSearchable>boolean</IsSearchable>
    <SortExpression>string</SortExpression>
    <SelectExpression>string</SelectExpression>
    </CustomField>
    <Value />
    </CustomFieldValue>
    <CustomFieldValue>
    <CustomField>
    <CustomFieldId>int</CustomFieldId>
    <TableFieldName>string</TableFieldName>
    <FieldType>Double or String or DateTime or PickList or Text or Boolean or Hyperlink</FieldType>
    <RecordType>Defect or Feature or Task or Incident or WorkLog</RecordType>
    <FieldLabel>string</FieldLabel>
    <PickListId>int</PickListId>
    <StringSize>int</StringSize>
    <Format>string</Format>
    <DisplayOrder>int</DisplayOrder>
    <IsMultiSelect>boolean</IsMultiSelect>
    <IsEditable>boolean</IsEditable>
    <IsCustomField>boolean</IsCustomField>
    <IsGroupable>boolean</IsGroupable>
    <IsSearchable>boolean</IsSearchable>
    <SortExpression>string</SortExpression>
    <SelectExpression>string</SelectExpression>
    </CustomField>
    <Value />
    </CustomFieldValue>
    </customValues>
    </AddIncident>
    </soap:Body>
    </soap:Envelope>
     

  •  12-07-2007, 6:43 AM 14301 in reply to 14270

    Re: IncidentHandler.AddIncident() method changed from 2007 to 2008 SDK

    When you add an incident you can call GetCustomFieldValuesList to get the list of custom fields:

    incident.CustomFieldValues = incidentHandler.GetCustomFieldValuesList(securityToken);

    The Update methods were broken in the initial release of the SDK, we fixed them and updated the SDK installers yesterday.  You can just redownload the SDK setup and re-install it.


    Dan Suceava
    http://www.axosoft.com
  •  12-17-2007, 10:02 AM 14443 in reply to 14301

    Re: IncidentHandler.AddIncident() method changed from 2007 to 2008 SDK

    Ok, so the question remains how do I add the custom field values to an incident when creating the incident?

    THIS:  incident.CustomFieldValues = incidentHandler.GetCustomFieldValuesList(securityToken);  is not going to do it, the value is not set anywhere. Can  you please provide a COMPLET example of inserting an Incident with custom field values since the SDK documentation is completely wrong?

    Thank you.


    jfkrueger

  •  12-17-2007, 1:38 PM 14449 in reply to 14443

    Re: IncidentHandler.AddIncident() method changed from 2007 to 2008 SDK

    Hello Joe,

    I think I may have already responded to your Support inquiry, but I wanted to post a reply here as well. Have you tried?:

    _incident.CustomFieldValues = 
    dh.GetCustomFieldValuesList(_securityToken);
    _incident.CustomFieldValues[0].Value = "test";

     

    It looks as if the value is set in that example. Let me know whether or not that works for you, and if not I'll try to find something else.


    Thank you,

    Tom Harder
    Axosoft Support
    support@axosoft.com
    1.800.653.0024 option 3
    --'Fear the Bug' Podcast--
  •  03-11-2008, 4:12 PM 15309 in reply to 14443

    Re: IncidentHandler.AddIncident() method changed from 2007 to 2008 SDK

    Issue
    The signature of the IncidentService.IncidentHandler's AddIncident() method has changed.  It no longer accepts the CustomFieldValues as a 3rd argument. 

    Solution
    You now need to populate the CustomFieldValues property of the IncidentService.Incident object, which you continue to pass in to the AddIncident() method as the 2nd argument.

     
    Hope this helps...
     

    Filed under: , ,
View as RSS news feed in XML

© 2002 - 2007, Axosoft, LLC. All Rights Reserved. | Privacy
Bug Tracking | Defect Tracking Videos | Help Desk Software