How to Map States in UI and in api.find for JST

When you use the method api.find for JST (Job Status Tracker), there is a set of values to represent the job state. 

api.find("JST", 0, 1, "-createDate", api.filter("targetObject", o?.typedId))?.find()

However, in the UI the states can have different names depending on the object type. For example, a job in JST ends up as "FINISHED", whereas in Data Analyzer > Data Loads the same job has the status "ready".

To be able to map these sets of values, always look the status up in the code – for your specific object. 

For example:

JST Status

(enum TrackerStatus)

DMDataLoad Status

(enum CalculationStatus)

Quote Status

(enum QuoteStatus)

0: WAITING_FOR_DISPATCH (PENDING)
1: QUEUED_FOR_EXECUTION
2: PROCESSING
3: FAILED
4: FINISHED
5: CANCELLED
6: INTERRUPTED
0=draft
1=pending
2=scheduled
3=processing
4=scheduled dirty
5=error
6=ready
7=cancelled
0: DRAFT,
1: OFFER,
2: DEAL,
3: REVOKED,
4: SUPERSEDED,
5: INVALIDATED,
6: LOST,
7: PARTIALDEAL

The numbers can also be useful for Support/Operations, since this is how the given state is saved in the database.

Found an issue in documentation? Write to us.