Service Desk Practitioners Forum

How to implement a counter

Go to solution
Jan Gunnar Helg
Honored Contributor.

How to implement a counter

I want to implement a rollback counter for use with changes.

If the status is changed from "Released to Production" back to "Build and test" I want the numeric Rollback counter field to be updated in increments of one.

This so we can see how many times a change might have been rollbacked.

How do I implement this? I am using HPOVSD 4.5 SP 17
George M. Meneg
Acclaimed Contributor.

Re: How to implement a counter

Hello Jan,

If this number is unique per change, it's easy.
If this number is global it can't be done without an external tool.

Enable a custom field of number type. Name it for example "rollback counter". Modify the change templates to set "rollback counter" to 0 on change creation, or create a db rule when a new change is created to set rollback counter to 0. This must be done otherwise the "Add" function will not work.

Enable a custom text field to hold the value of the previous status, name it for example "prev status".

Create a UI rule when item is opened to set prev status to Status.

Then create a db rule that does the following: When item is changed and previous status=Released to Production and Status(*)=Build and Test to update data and set rollback counter to add 1.0 to rollback counter.

(*) means that you must check "Evaluate this rule when this field has been changed".

PS, from what I see you have not assigned any points to any of the six answers to your question. Assigning points to people who try to help you by answering your question is strongly encouraged. Take a look at
menes fhtagn
Jan Gunnar Helg
Honored Contributor.

Re: How to implement a counter

Thank you, Ill test it out.

Sorry about not granting points to threads, I'll do that now