iwhen Non-Production issue Boolean field value is true with automatically set the values

Srinivasu2
Tera Contributor

Hi Team,

 

Whenever Non - Production Issue Boolean field value is true in incident form will automatically set values as below

 

1. State  -  On hold

2. On hold reason - Awaiting fix

3. Configuration item - US Apps

 

I have used below BR to set those values

 

Srinivasu2_0-1715049023257.png

 

I have used below script to set those values in incident form

Srinivasu2_1-1715049064633.png

 

US apps is not setting in Configuration field, please let me know US Apps is not setting in configuration item

 

Srinivasu2_2-1715049236323.png

 

Thanks,

Srinivasu

 

3 REPLIES 3

Srinivasu2
Tera Contributor

Hi Community,

 

I have changed the script like as below

 

(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
   
    current.state = '3';
    current.hold_reason = '6';
    current.cmdb_ci = "020a030d1bed86101fe58e46604bcbe6";// sys id of US Apps
    current.setWorkflow(false);
    current.update();
 
I have used below code but US Apps is not setting in Configuration item field 
 
Srinivasu2_0-1715055450856.png

 

 

Thanks,

Srinivasu

@Srinivasu2 OOTB Configuration item field has a reference qualifier defined on it. This reference qualifier might be filtering out your US Apps CI item from the configuration item list.

 

Screenshot 2024-05-07 at 10.13.53 AM.png

This could be the reason why you are not able to set US Apps as your CI Item on the incident form.

 

Hope this helps.

@Srinivasu2 

  1. First check the configuration item field dictionary. There should be reference qualifier and check if your configuration item satisfies the Ref. Qual condition
  2. Configuration Item field is dependant on Company field. Please take the Company field on the form layout and see if the company field is setting the value automatically or not.
  3. Your code is correct but if you have static value to set on the incident form then why you are doing this by script? It can be done by Action tab on business rule.

If this answer is helpful please mark correct and helpful!