Fleet Admiral
Fleet Admiral
989 views

Trouble with using IncidentManagement() script library

Hi All,

 

Hope you all are doing great...

 

Here to trouble you again.

 

I am using system.library.IncidentManagement.CreateIncidentRequest() method as follows:

 

function CreateIncident()
{
 var IncMgmtSvc = new system.library.IncidentManagement.IncidentManagement();
  IncMgmtSvc.user="falcon";

  var retrieveReq = new system.library.IncidentManagement.CreateIncidentRequest();
 
  //print("\n the value of retrieveReq" + retrieveReq.Category.getValue());

retrieveReq.Category = "incident";
retrieveReq.Subcategory="failure";
retrieveReq.ProductType ="error message";
retrieveReq.severity = "4 - Low";
retrieveReq.InitialImpact = "3 - Multiple Users";
retrieveReq.AffectedItem = "Microsoft Office 2007";
retrieveReq.Service = "Applications";
retrieveReq.PrimaryAssignmentGroup = "application";
retrieveReq.IncidentDescription = "Sending from JS using IMWS";
retrieveReq.BriefDescription = "Title INC from JS using IMWS";
retrieveReq.AssigneeName ="Incident.Manager";

try
{
        var retrieveResp = IncMgmtSvc.invoke(retrieveReq);

 

 

i am getting retrieveResp as OBJECT but incident is not created.

 

i tried retrieve example as given in web service tailoring book its working fine.

 

Help me on this issue.

 

 

Thanks and regards,

abhijit

 

 

 

 

 

 

 

0 Likes
11 Replies
Absent Member.
Absent Member.

Its because call you are making to the Incident Management WSDL is wrong.

 

Values are not getting set properly into the fields. Though i am surprised that you didnt got the error while calling the web-service.  

Fleet Admiral
Fleet Admiral

Hi Mukesh,

 

Thanks for the reply.

 

I would appreciate if you would guide me to the right way to invoke CreateIncidentRequest().

 

Thanks and regards,

Abhijit Khewale

0 Likes
Fleet Admiral
Fleet Admiral

 You are not assigning the values properly. Values should be assigned with,

 

                    retrieveReq.model.instance.Category.setValue("incident");  

 

Similarly set other values as well and call invoke()        

0 Likes
Fleet Admiral
Fleet Admiral

Hi there,

 

still no luck.

 

re,

abhijit

0 Likes
Absent Member.
Absent Member.

Are you trying to consuming the IM wsdl of another Service Manager system ? And the field you have mentione in your js call to wsdl are the mandatory one ?

0 Likes
Fleet Admiral
Fleet Admiral

Hi Mukesh,

 

I am trying to consume web service of my own server.

 

I dont have SM front of me that why not able to share code with you.

 

One thing i observerd that in number file Incident Management Number is increasing everytime as i am trying to excute script.

 

 

thanks and regards,

abhijit khewale

0 Likes
Fleet Admiral
Fleet Admiral

Hi

 

   That means incident should have got created on SM end. By any chance did you check whether incidents are getting created?

 

   If not, please check sm.log at that point of time for any errors and post it this thread.

 

  Also please share the code you are trying to call to consume SM webservices.

0 Likes
Fleet Admiral
Fleet Admiral

Hi all,

 

Kindly suggest on this...

 

 

 

Thanks and regards,

abhijit

0 Likes
Absent Member.. Absent Member..
Absent Member..

Hello,

 

we have test function, try it (only plz set all your obligatory parameters):

 

functionCreateTestInteraction()

{

      try

      {

            var InteractionMgmtService =newsystem.library.ServiceDesk.ServiceDesk();

            InteractionMgmtService.user     = "falcon";

            InteractionMgmtService.location = "http://localhost:13080/SM/1/ws";

 

            var CreateInteractionRequest =newsystem.library.ServiceDesk.CreateInteractionRequest();

 

            CreateInteractionRequest.Interaction.CallbackContact.setValue("disp");

            CreateInteractionRequest.Interaction.NotifyBy.setValue("E-mail");

            CreateInteractionRequest.Interaction.ConfigurationItem.setValue("Applications");

            CreateInteractionRequest.Interaction.Title.setValue("TEST WS");

            CreateInteractionRequest.Interaction.InitialImpact.setValue("2");

            CreateInteractionRequest.Interaction.Severity.setValue("3");

            CreateInteractionRequest.Interaction.Category.setValue("incident");

            CreateInteractionRequest.Interaction.Subcategory.setValue("other");

            CreateInteractionRequest.Interaction.Description.Description_newInstance().setValue("line 1");

CreateInteractionRequest.Interaction.Description.Description_newInstance().setValue("line 2");
 

            var CreateInteractionResponse =InteractionMgmtService.invoke(CreateInteractionRequest);

            if(CreateInteractionResponse.isFault())

            {

                  return(-1);

            }

            else

            {

                  return(CreateInteractionResponse.Interaction);

            }

      }

      catch(e)

      {

            print(e);

            return(-1);

      }

}

0 Likes
Fleet Admiral
Fleet Admiral

Hi V3,

 

Thanks for your reply.

 

I tried your code but gives me error as : CreateInteractionRequest.Interaction has no properties.

 

I guess somewhere syntax is wrong.

 

Kinldy send me proper or correct syntax.

 

Thanks and regards,

Abhijit K

 

0 Likes
Fleet Admiral
Fleet Admiral

Hi all,

Kindly help on this issue..

re,
abhijit
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.