so basically item.getOwner(); is always returning original owner of the workitem. but i need to grab workitem owner after its being forwarded in order to check if its delegated owner is same person as requester.. but method getOwner(); is only giving me original owner of the workitem.. so is there any method i can check who is the exact approver of the workitem???
Your program should work as expected. When the requester and the delegated owner are the same, it will return the manager of the new owner.
item.getOwner() will return the current owner of the work item, not the original one. For example, if the initial owner was X and the item was forwarded to Y, then item.getOwner() will return Y, while X will be stored in the work item’s owner history.
Could you please share the work item object with me so I can review it further?
nope some how its returning me the original owner rather than the forwarded one.
As you can see in logs i forwarded to myself but item.getOwner(); is returning me original owner.
Logs:
2025-09-05 14:01:15,941 DEBUG LOGS:166 - ENTRY : Global rule sailpoint.object.Identity@2ebad4f8[id=8ae49aa16ae0fb66016b77350304701e,name=AB3117]
2025-09-05 14:01:15,941 DEBUG LOGS:166 - Current Owner Name AB3117
2025-09-05 14:01:15,941 DEBUG LOGS:166 - Requester Name NP36FH
Based on the example above, your rule is working correctly. The current owner of the work item is AB3117, and you forwarded two times to the same user AB3117 (as per the owner history). The requester is NP36FH.
If you instead forward it to NP36FH, then your rule will return NP36FH’s manager.
ok the thing i noticed was if i dont apply any global forward rule i am getting new owner as myself in owner history but once i add global workitemforward rule its giving me original owner only in workitem xml.
could it be since we are adding this rule in global workitem forward rule. does that rule trigger before the forward is done because that could be the reason its giving us original owner
The Global work item forwarding rule is more open-ended; if one is specified, it runs every time a work item is opened or forwarded in the system to determine if the work item needs to be sent to a new owner for further analysis or action. Only one global forwarding rule can be specified per installation, but it is important to note that it runs for every work item every time it is opened, so complex and time-intensive logic in the rule could substantially affect system performance.