Client script OR Script include?

B_pppppp
Tera Contributor

I have two fields on incident form. Both are reference to cmdb_ci_server. I want the values ​​from which I could choose for the second field to have as a parent what I chose in the first field. What should I do?

2 ACCEPTED SOLUTIONS

Robbie
Kilo Patron
Kilo Patron

Hi @B_pppppp,

 

You can actually achieve this by use of a reference qualifier, assuming the cmdb_server data is set up correctly.

 

If you take a look at the 'Out Of Box' (OOB) 'Service' and 'Service Offering' fields and dependency, you'll notice that the 'Service Offering' field is configured to filter by whatever has been entered into the 'Service' field.

Right click, and select 'Configure Dictionary' against the 'Service Offering' field and you'll see the following syntax under the 'Reference Specification' tab: (Screen shot below to help)

 

javascript:'parent='+current.business_service;

 

You'll need to implement something similar using your fields. For example, assuming your CI field 1 is the parent of CI field 2, you can configure as follows:

- Change the 'Reference' field under 'Reference Specification' tab to point to your 'ci_field_1'

- Select 'Advanced' on the 'Use reference qualifier' field

- Add the following syntax within the 'Reference qual' field:  javascript:'parent='+current.your_ci_field_2;

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

Screenshot 2024-04-12 at 13.44.19.png

View solution in original post

Hi @B_pppppp,

 

A slight tweak to your reference qualifier. Copy paste the below:

javascript:'parent='+current.u_application + '^operational_status=1'

 

(Also make sure there are no dictionary overrides - See the 'Dictionary Overrides' related list at the bottom of the page)

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

View solution in original post

4 REPLIES 4

Robbie
Kilo Patron
Kilo Patron

Hi @B_pppppp,

 

You can actually achieve this by use of a reference qualifier, assuming the cmdb_server data is set up correctly.

 

If you take a look at the 'Out Of Box' (OOB) 'Service' and 'Service Offering' fields and dependency, you'll notice that the 'Service Offering' field is configured to filter by whatever has been entered into the 'Service' field.

Right click, and select 'Configure Dictionary' against the 'Service Offering' field and you'll see the following syntax under the 'Reference Specification' tab: (Screen shot below to help)

 

javascript:'parent='+current.business_service;

 

You'll need to implement something similar using your fields. For example, assuming your CI field 1 is the parent of CI field 2, you can configure as follows:

- Change the 'Reference' field under 'Reference Specification' tab to point to your 'ci_field_1'

- Select 'Advanced' on the 'Use reference qualifier' field

- Add the following syntax within the 'Reference qual' field:  javascript:'parent='+current.your_ci_field_2;

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

Screenshot 2024-04-12 at 13.44.19.png

B_pppppp
Tera Contributor

Thank you! I used this ref quali "javascript: 'parent='+current.u_application^operational_status=1". The first part is working but when I added the second part of the filter (operational_status) it stopped working

Hi @B_pppppp,

 

A slight tweak to your reference qualifier. Copy paste the below:

javascript:'parent='+current.u_application + '^operational_status=1'

 

(Also make sure there are no dictionary overrides - See the 'Dictionary Overrides' related list at the bottom of the page)

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

Astik Thombare
Tera Sage

Hi @B_pppppp ,

 

could you please elaborate your requirement more . it is not clear 

 

Thanks,

Astik