Kaseya Community

How do you write the result of a calculation to a field?

This question is not answered

I'm trying to implement a fairly simple request -- counting the total number of times each ticket has been assigned to technicians.

I added a custom field to the service desk, TimesAssigned (type: integer). 

Then I added a line to the change procedure... when the assignee changes, run this, which should increment TimesAssigned by 1:

AssignCustomField("TimesAssigned", "[$TimesAssigned$]+1", "Continue on Fail")

I've tried the second argument several different ways and none work:

  • [$TimesAssigned$] + 1
  • [$TimesAssigned$]+1
  • [$TimesAssigned$+1]
  • [$TimesAssigned$]++

Is there any way to make this work?

All Replies
  • Jeff, I feel your pain!

    The ability to do even simple math seems to be missing from Service Desk. In fact, even basic numeric comparisons became frustrating when the procedures determined that "10" < "3" for some string-comparison-based reason.

    I've resorted to external scripts to handle math functions in SD. I can't share the code because it's proprietary to our MSP solution, but once you realize the limitation of the procedure language in SD, the solution isn't that difficult to come up with. (call script with the args, write result to file, read result from file is one method.)


  • BTW - look at the post here: community.kaseya.com/.../21443.aspx - for an example of using a script to return a value. A single script can perform all basic math functions and comparisons by passing the function name and the two values, such as "add 4 1", which would return "5".

    Would be easy to build with VB or most any other scripting language.


    [edited by: gbarnas at 7:45 AM (GMT -8) on Feb 9, 2016]