database view combinining sys_user_group and incident with a custom field

Bh31
Tera Contributor

I need to create a database view to report against, that has a simple view of sys_user_group_name, sys_user_group_u_cio_rollup ( custom field ) incident_assignment_group and incident_number

 

find_real_file.png

What I get here is the incident number and the assignment group, but the CIO_Rollup field only contains Empty records.  Filtering out empty records returns no records at all.

find_real_file.png

IIdeally I would have the CIO rollup field populated, and the Name field populated from the sys_user_group table.

Both table entries have 'left join' selected, as unselecting either of them returns no records at all.  I think I have a general misunderstanding on how this is supposed to work.  Any help appreciated.

 

 

1 ACCEPTED SOLUTION

Abhijit4
Mega Sage

Hi,

I think there is problem with your where clause where you are comparing name with sys_id.

Please try below,

gr_sys_id=inc_assignment_group

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

View solution in original post

3 REPLIES 3

Abhijit4
Mega Sage

Hi,

I think there is problem with your where clause where you are comparing name with sys_id.

Please try below,

gr_sys_id=inc_assignment_group

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

Bh31
Tera Contributor

@Abhijit thank you, yes -- the name being a reference field meant I needed the sys_id rather than the name.

 

I am glad that your issue is resolved.

Thanks and Regards,
Abhijit

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP