Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Jim Reynolds
    Bulk Extract IncidentsAnswered
    Topic posted November 3, 2019 by Jim ReynoldsRed Ribbon: 250+ Points, tagged REST 
    50 Views, 7 Comments
    Title:
    Bulk Extract Incidents
    Content:

    Hello,

    I am running a bulk extract of incidents using the REST API. Has anyone done this before? Can anyone give me a rough estimate of the time it will take before I am able to download the extract?

    When looking up the progress of the extract the only information is available is that is is still in the "run" state. 

     

    Image:

    Best Comment

    Edson Junior

    here you go:

    "filters":
                    [
            {
                    "leftOperand": "createdTime",
                   "filterOperator": {
                                    "lookupName": ">"
                    },
                    "rightOperand": "2018-01-14T00:00:00.000Z"
                    }
      ],
    

    Comment

     

    • Edson Junior

      Hi Jim,

      I don't think there is a straightforward answer to this question. It depends on what you are extracting, and if your request is using filters and selected columns or it is extracting the whole database.

      Note that BulkExtract is packing up incidents table and its related tables, including custom objects and custom fields. In other words, giving my implementation I can get it done in X hours/min and it giving your implementation and how complex it is it will give you a different time.

      With that said,  if it is applicable for the purpose of why you are extracting data, I'd encourage you to apply filters and select columns needed. Use a batch approach, for instance, incidents from mm/dd/yyyy to mm/dd/yyy, can improve your ability to work early with the resulted data. 

      I hope this helps somehow.

      Edson

       

    • Jim Reynolds

      Thanks for the info. Edson. Just doing a bulk extract of everything is taking a very long time. Upwards of 2 weeks now.

      I'm looking at cancelling the current one and using a filter to say extract incidents created after X date.

      I can see filters can be used from the docs, but there is no example on how to use them.

      Does anyone know how to add a date filter to the extract request?

       

      {
       "class": "Incident",
       "name": "ExtractExample",
       "state": {
         "lookupName":"Run"
         },
       "version": "v1.4"
      "filters": {%CREATED AFTER X DATE FILTER HERE%}
      }
      
      • Tushar Gupta

        Hi Jim,

        Another solution for this can be that you can build a .net Add-In wherein you can fetch the data from the report or using ROQL.

        Thanks

      • Edson Junior

        here you go:

        "filters":
                        [
                {
                        "leftOperand": "createdTime",
                       "filterOperator": {
                                        "lookupName": ">"
                        },
                        "rightOperand": "2018-01-14T00:00:00.000Z"
                        }
          ],
        
        • Jim Reynolds

          Thanks Edson, I have tried this, but it is not working. I've played around with the date format and order and brackets and no bueno, so I'm not sure what is causing the problem. Receiving an error that is specifying the filter is the problem.

          • Edson Junior

            Change "rightOperand" value from "2018-01-14T00:00:00.000Z" to "'2018-01-14T00:00:00.000Z'".
            There is a single within double-quotes. Apologize for the first example that didn't work well.

            Edson