How to get Previous value of record assignment

Supriya25
Tera Guru

Hi,

Please help me on below issue

 

SCTASK was Assignments changing as per situation, sometimes to groups, sometimes to Users.


Scenario 1 : Initially it was assigned to a user "David" , From David to it was assigned to Group : "Software", finally From Software group to it was assigned to "Hardware" group ( currently it was assigned to Hardware group).

Now I want to know that , to whom it was assigned Previously either group/user and it's value. (expected result: Software group ).

David-->Software group--->Hardware group .

 

Scenario 2: Initially  it was assigned to :Hardware group---> David user---> software group ( currently it was assigned to Software group)..
Now I want to know that , to whom it was assigned Previously either group/user and it's value. (expected result: David User).

 

Kindly let me know how to get this solved.

 

 

11 REPLIES 11

Sainath N
Mega Sage
Mega Sage

@Supriya25 : You could create metric definitions [metric_definition] similar to what we have on the Incident table for Assignment Group, Assigned to, so the system captures every change on these fields and logs the entries in the [metric_instance] table, which can be easily reportable. Below are the screenshots that will help you.

 

sainathnekkanti_0-1703096342613.pngsainathnekkanti_1-1703096405398.png

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Hi Sai,

 

how about in Scoped Application? do I have to create Metrics there also ?

 

Even after creating Metrics we can get current field value, but how about we can get one step back Previously on which field we made changes

@Supriya25 : Yes, you can create metrics for scoped application tables as well. With metrics you can go to any level as it captures all the values from start to end (complete lifecycle) of the ticket. Querying system audit tables is not advisable.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

I understand , here we are looking at Metric table and telling that previously it was assigned to User Or group, clearly system showing . 

BUT  my concerns
how can we get that previous assignment value in-form of RESULT value from code  with Querying Metric table. 

 

Plse Advise .

 

Supriya25_1-1703098587636.png

 

  

@Supriya25 : Based on the latest entry in this table, as you mentioned, you can determine if this is an "assignment group" or an "assigned to" change. Using the script, we can look for the second entry (using some counter variables) in the table of that type and get the value from the value field.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.