5 Replies Latest reply on Apr 11, 2011 1:52 PM by 827118

    Auto task creation failing in Service Request Creation API

      Hi All,

      I am using Oracle Applications 11.5.10 . While trying to create a Service Request from the application , when a problem code value is passed , the SR gets created automatically with all the tasks attached to a task template mapped to the problem code . But when I try to do the same from the cs_servicerequest_PUB.Create_ServiceRequest public API , the task assignment fails with the following error :

      No Resource Found. Please Try Again.
      API Error(CS_SR_TASK_AUTOASSIGN_PKG.ASSIGN_TASK_RESOURCE). Unable to automatically assign Task Owner. Please Check your Territory Set Up or manually assign Task Owner.
      API Error: System could not automatically Assign an Owner for task template: Auto Task Grouping Problem. Task Owner field is Mandatory

      The territory setup seems to be fine in the environment. I am calling the API with P_auto_assign => 'Y',p_auto_generate_tasks => 'Y' . Could anyone help me out with what could be the probable
      problem and what other check should I do .

        • 1. Re: Auto task creation failing in Service Request Creation API
          Srini Chavali-Oracle
          Pl see if MOS Doc 394390.1 (How to Create a Service Request and a CONTACT for the Service Request Programatically using cs_createservicerequest_pub.Create_ServiceRequest API) can help

          There are a lot of documents in MOS that refer to errors with this API. Pl search with "Create_ServiceRequest" to find these docs, and see if any of them can help

          • 2. Re: Auto task creation failing in Service Request Creation API
            Hussein Sawwan-Oracle

            Please see if these docs help.

            Unable To Create Task On Sr Form Getting Error FRM- 40742 [ID 1108319.1]
            How To Use Automatic Assignment Of Auto-Generated Tasks With Groups [ID 311385.1]
            Assignment Manager Errors With ''Area Code'' As Territory Transaction Qualifier [ID 400798.1]

            • 3. Re: Auto task creation failing in Service Request Creation API
              Hi Srini / Hussein,

              I have gone through the metalink notes and have verified the setup changes , profile option values in the environment and they look good . The following is the code snippet I am using to verify the task creation. The below code is creating the tasks properly when I set the profile "Service: Service Request Task Owner Auto Assignment Level": to "Individual", but if this profile option is set to "Group", then the task assignment fails with the error already mentioned . In our project this profile value should be set only to "Group" and not "Individual" . Please let me know If there are any more checks I can perform to resolve this.

              CURSOR c1
              SELECT *
              FROM apps.cs_incidents_all_b
              WHERE INCIDENT_id=3810;
              ln_user_id := 30967;
              ln_resp_id := 55251;
              ln_resp_appl_id := 514;
              APPS.FND_GLOBAL.APPS_INITIALIZE( USER_ID=>ln_user_id
              FOR c1_rec IN c1
              l_service_request_rec.request_date := trunc(c1_rec.incident_date);
              l_service_request_rec.type_id := c1_rec.incident_type_id;
              l_service_request_rec.status_id := c1_rec.incident_status_id;
              l_service_request_rec.severity_id := c1_rec.incident_severity_id;
              l_service_request_rec.summary := 'TEST SR THROUGH API';
              l_service_request_rec.caller_type := c1_rec.caller_type;
              l_service_request_rec.customer_id := c1_rec.customer_id;
              l_service_request_rec.sr_creation_channel := 'PHONE';
              l_service_request_rec.group_type := 'RS_GROUP';
              l_service_request_rec.bill_to_site_use_id := c1_rec.bill_to_site_use_id;--DERIVE -- FROM HZ_PARTIES
              l_service_request_rec.ship_to_site_use_id := c1_rec.ship_to_site_use_id;--DERIVE
              l_service_request_rec.bill_to_party_id := c1_rec.bill_to_party_id;--DERIVE --PARTY_ID
              l_service_request_rec.ship_to_party_id := c1_rec.ship_to_party_id;--DERIVE --PARTY_ID
              l_service_request_rec.problem_code := c1_rec.problem_code;
              l_service_request_rec.incident_location_id := 5500;
              l_service_request_rec.incident_location_type := 'HZ_PARTY_SITE';

              cs_servicerequest_PUB.Create_ServiceRequest (
                                            p_api_version => 4.0,
                                            p_init_msg_list => FND_API.G_TRUE,
                                            p_commit => FND_API.G_TRUE,
                                            x_return_status => lx_return_status,
                                            x_msg_count => lx_msg_count,
                                            x_msg_data => lx_msg_data,
                                            p_resp_appl_id => ln_resp_appl_id,
                                            p_resp_id => ln_resp_id,
                                            p_user_id => ln_user_id,
                                            p_login_id => NULL,
                                            p_org_id => ln_org_id,
                                            p_request_id => null,
                                            p_request_number => ln_sr_num,
                                            p_service_request_rec => l_service_request_rec,
                                            p_notes => l_notes_table,
                                            p_contacts => l_contacts_tab,
                                            P_auto_assign => 'Y',
                                            p_auto_generate_tasks => 'Y',
                                            x_sr_create_out_rec => l_service_request_rec_out,
                                            p_default_contract_sla_ind =>'N',
                                            p_default_coverage_template_id => 0);
              • 4. Re: Auto task creation failing in Service Request Creation API
                Hussein Sawwan-Oracle

                If none of the above docs helps, I would suggest you log a SR.

                • 5. Re: Auto task creation failing in Service Request Creation API
                  Hello Hussen/Meenakhi,

                  Could you please letme know where the setup for problem code, based on which the tasks are automaically created.

                  That would really help me.

                  Thank you,