Using the API to validate your own rules

Dec 16, 2014 | JobTracker Tips

Do you ever wish you could reach into the internals of JobTracker and ask questions of your data? If you happen to have programming skills – or if you’re willing to pay someone who does – you can do just that.

For example, recently I spoke with a customer who wanted to improve the quality of the numbers they report on. They noticed they had a persistent problem with employees creating Job Phases but then not assigning all the appropriate activities and forms to those phases. They asked me if it was possible simply to find all the jobs where this might be a problem.

There’s not a way to answer that question using views, reports, or the calendar, but this sort of question is actually pretty easy to solve with our APIprovided you have access to programming skills. An API (short for Application Programming Interface) is what lets programmers manipulate another piece of software. It’s kind of like a remote control, but you have to know how to use it.

The hardest part of writing a tool like this is understanding the problem. In this case, it boils down to the following:

  • Loop through all accounts in the system
  • For each account, loop through all its jobs
  • IF the job has phases, then loop through all of its forms and activities
  • IF any of those forms or activities don’t have a phase assigned, then spit out a warning message

The other hardest part of solving a problem like this is making a friendly user interface for it. I punted on that. I wrote a sample for this customer showing how to get the data out of Moraware, but I didn’t write a fancy user interface for it. Instead I wrote this as a command line program, which is intended for a fairly technical user.

Below is a picture of the sample code I wrote for this problem (email me if you want the actual code). If you don’t know how to program, it will look like jibberish, but it’s worth knowing that this type of thing is possible, and that it’s not an enormous amount of work (until you try to make it user friendly, self-recovering, etc.).

If you want some custom programming done but don’t know how to code, you can reach out to a local software development shop or better yet, one of our partners. We don’t do custom programming, but our partners do.