Hello Katherine,
Sorry - it took a while to get to the bottom of this.
RESOLUTION SUMMARY
There are two issues here, which combined give the behaviour seen.
ISSUE 1 - Change Order List number sort is by "id" and not "ref_num."
This issue is by design to handle the string field sorting.
ISSUE 2 - Multi-server environments can get "id" and "ref_num" alignment different
This requires a low-level design change which cannot be accommodated in the current production release.
Defect DE37910 is remaining in a Deferred state for correction in a future release.
RESOLUTION DETAILS
ISSUE 1 - Change Order List number sort is by "id" and not "ref_num."
This issue is by design to handle the string field sorting.
The Change Order List Search uses "id" as the key sort field instead of the Change Order Number.
The reason for this choice is that the ticket "ref_num" is stored as a string.
This is done to allow prefixes and suffixes. Such as "EUR:108542" or "USA:152."
In particular it prevents ref_num ticket number collisions when two different systems are merged.
However, because ref_num is a string, it is not a good field for sorting on, as it is subject to sort issues.
For example, a sort on this string list produces the "wrong" numeric sort result, even though it is a "correct" sort of the string:
1
13
151
2
22
2078
3
4
45
5
etc
To get around this, the ref_num is sorted in lists by the "id" instead, which is an integer. Integers are always sorted correctly. This typically works, because data entry and most integration points with CA SDM will keep the ref_num and id in the same sequential order.
The expected behaviour is that it should be impossible to get a ref_num into a difference sequence than the id.
The only exception should be via a direct data load of a table not sorted sequentially by ref_num or database manipulation. However, best practice should keep this in-line also.
The above functionality is correct as per the design of the product, and is not under consideration for change at this point.
ISSUE 2 - Multi-server environments can get "id" and "ref_num" alignment different
Under some circumstances in multi-server environments, it is possible for the "id" and "ref_num" sequential alignment to differ. This occurs due to the number distribution and caching mechanism. The focus of the current design is primarily around preventing dual-allocation of ticket numbers, in an environment where servers are distributed.
This requires a low-level design change to correct. This cannot be accommodated in the current production release.
Defect DE37910 is remaining in a Deferred state for correction in a future release.
POTENTIAL WORKAROUNDS
There are no ideal workarounds. The best advice may be to treat this as a known issue and cover with user training.
If only reports or dashboards are needed, then they could be run off the ref_num field.
A non-viable workaround is to periodically extract all of the data, rearrange into correct order and reimport. This is not tenable in practice due to the effort involved and data risk.
A customisation may address this issue, but would require further research. A colleague suggested the following. Please note though that it has not been tested and would need thorough review. Not only to confirm that it works, but that it has no other adverse impacts.
- - - -
Change the sort order of some domsets in Majic with a .mod file in site\mods\majic. Pay attention to the string "chg_ref_num DESC".
MODIFY FACTORY chg DOMSET chg_list_web "chg_ref_num DESC, sched_start_date=sched_start_date DESC+sched_end_date DESC, id DESC, risk DESC, mintime=min(attached_slas.time_to_violation), mintgt=min(target_times.target_time), status=status.sym, priority=priority.sym DESC, category=category.sym, chg_ref_num" "" STATIC;
MODIFY FACTORY chg DOMSET chg_list_web_active_only "chg_ref_num DESC, sched_start_date=sched_start_date DESC+sched_end_date DESC, id DESC, risk DESC, mintime=min(attached_slas.time_to_violation), mintgt=min(target_times.target_time), status=status.sym, priority=priority.sym DESC, category=category.sym, chg_ref_num" "" STATIC { WHERE "active=1"; };
- - - -
This changes falls outside of scope for CA Support, but a paid engagement via CA Services or a CA Business Partner could review this for you. Or the CA Community for Service Management has many users experienced with SPL who may be able to comment further.
WARNING: The change would also leave a site exposed to the string sorting raised in "Issue 1" above, and so is only valid on sites where pure numeric sorts are used, which currently have similar numeric lengths, such as most being six digits.
CLOSING COMMENTS
Apologies for the length of time in getting to root cause.
An apparently simple question required low-level analysis within the product to understand the behaviour.
If you do decide to go through a customisation approach to attempt further resolution in the meantime, I recommend looking into that code fragment, and reaching out here to the CA Communities in the first instance in a new post.
Otherwise, the Defect has been marked as "Deferred" - not "Closed" - and so is still valid for consideration in a future release.
Thanks, Kyle_R.