Integrations and APIs for Service

Get Involved. Join the Conversation.


    Praveen Woody
    How do I get a handle on Tasks to check if there any open...
    Topic posted May 19, 2019 by Praveen WoodySilver Medal: 2,000+ Points, tagged Connect PHP, REST, SOAP 
    102 Views, 7 Comments
    How do I get a handle on Tasks to check if there any open tasks before closing the incident

    Everytime the status of the incident is set to closed, before incident save, I want to check (from Agent Console) if there are any open tasks associated with that incident. If there any open tasks, I want the agent to get a message asking them to close that task before closing the incident and should prohibit the user to close the incident till they close all open tasks associated with the incident.

    Is there a sample code I can use to have this done?


    Thanks in advance




    • Sebastiaan Draaisma

      Hi Praveen.

      There are different roads that you could take

      1.) A js API in a browser component

      window.external.cancelcomplete(Boolean continue, String message);

      Used to cancel a close operation if continue = false and display message in a message box

      2.) An add-in that creates an event handler that you could use in a workspace rule

      DialogResult dialogResult = MessageBox.Show("Are you Sure?", "Some Title", MessageBoxButtons.YesNo);
      if(dialogResult == DialogResult.Yes)
      else if (dialogResult == DialogResult.No)

    • Praveen Woody

      THanks Sebastiaan. I am new to this. Can I know if there is documentation for .net stuff for console?

    • Sebastiaan Draaisma

      Hi Praveen.

      Yes, there is technical documentation on all APIs with sample code here:

      You could make your decision based on your skills (C or Javascript), I myself (little experience with add-ins) would do this in js but it's all up to you :-)

    • Praveen Woody

      Thanks again Sebastiaan. Would a JS API work from Agent Console (.net client)?

    • Sebastiaan Draaisma

      Yes it would. It works very nicely.
      You would place a browser component (BC) in your workspace and have the BC load the page when the workspace is opened so it will work on the background. You could then use the js to check if there are any tasks and perform an action when the status is changed. You would need to capture the original status with an onload function when the workspace is opened and compare that with the current status when the workspace get's updated.


    • Praveen Woody

      Will try Sebastiaan and will update you. Thanks again bud.

    • Sebastiaan Draaisma

      See attached read/write example to get you started