1

I am retrieving the status of an Automation and do not know what the status codes represent. I've seen documentation on this, but can no longer find it.

2 and 3 are being returned most frequently:

<script language="javascript" runat="server">
    Platform.Load("core", "1");
// Create an API Retrieve RequestPerform request.
    var RetrieveRequest = Platform.Function.CreateObject("RetrieveRequest");

    // Set the request type
    Platform.Function.SetObjectProperty(RetrieveRequest, "ObjectType", "Program");

    // Set the columns
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Program.Name");
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Program.ObjectID");
    Platform.Function.AddObjectArrayItem(RetrieveRequest, "Properties", "Program.Status");

    // Create a filter
    var RetrieveFilter = Platform.Function.CreateObject("SimpleFilterPart");
    // By ExternalKey/CustomerKey
    Platform.Function.SetObjectProperty(RetrieveFilter, "Property", "CustomerKey");
    Platform.Function.SetObjectProperty(RetrieveFilter, "SimpleOperator", "equals");
    Platform.Function.AddObjectArrayItem(RetrieveFilter, "Value", ExternalKey);


     // Add the filter to the retrieve
    Platform.Function.SetObjectProperty(RetrieveRequest, "Filter", RetrieveFilter);

    // Do the retrieve
    var StatusAndRequestID = [0,0];
    var Program = Platform.Function.InvokeRetrieve(RetrieveRequest, StatusAndRequestID); 
    var status = StatusAndRequestID[0];
    var requestid = StatusAndRequestID[1];

    //Find the ObjectID
    var objectid = "";
    var qd_status1 = "";
    for ( var c = 0; c < Program.length; c ++ ) {
        objectid = Program[c].ObjectID;
        qd_status1 = Program[c].Status;
    }   
</script>

Output:
qd_status1: 2

1

ProgramStatusID Name Description

-1 Error Program errored out

0 BuildingError Program errored out when it was being built

1 Building Program is being built with activities, schedule etc.

2 Ready Program is ready to be started

3 Running Program is running

4 Paused Program is paused from its running state

5 Stopped Program has been stopped

6 Scheduled Program has been scheduled

7 AwaitingTrigger Waiting for Trigger

8 InactiveTrigger Trigger is Inactive

9 Skipped Program step has been skipped

10 Initialized Program has been initialized

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.