Disable REQ Approval for Technical Catalog

Nisha30
Kilo Sage

Hello Experts,

How do I disable the REQUEST level Approval for only Technical Catalog. 

We have RITM approval and thats what we want only .

How to disable REQ Approval  for only Technical Catalogs?

 

Thanks

 

1 ACCEPTED SOLUTION

@Nisha30 

like this

var ritmSysId = current.sysapproval;
var ritmRec = new GlideRecord('sc_req_item');
ritmRec.addQuery('sys_id', ritmSysId);
ritmRec.addEncodedQuery('cat_item.sc_catalogsLIKE742ce428d7211100f2d224837e61036d'); // the sysId is for Technical Catalog
ritmRec.query();
if (ritmRec.hasNext) {
    current.state = 'approved';
}

AnkurBawiskar_0-1743431644507.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

25 REPLIES 25

@Nisha30 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

hi @Ankur Bawiskar 

 

Tried below BEFORE INSERT Business rule. seems not working

 

 
 var itemcategory = sysapproval.cat_item.sc_catalogs.getDisplayValue();
  
    var istech = new GlideRecord('sc_req_item');
    istech.addQuery('sc_catalogs', itemcategory);
    istech.query();
    if(istech.next())
    {
        if(itemcategory == 'Technical Catalog')
        {
           
            istech.setWorkflow(false);
            //current.state== 'approved';
        }

    }

@Nisha30 

like this

var ritmSysId = current.sysapproval;
var ritmRec = new GlideRecord('sc_req_item');
ritmRec.addQuery('sys_id', ritmSysId);
ritmRec.addEncodedQuery('cat_item.sc_catalogsLIKE742ce428d7211100f2d224837e61036d'); // the sysId is for Technical Catalog
ritmRec.query();
if (ritmRec.hasNext) {
    current.state = 'approved';
}

AnkurBawiskar_0-1743431644507.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Nisha30 

Thank you for marking my response as helpful.

I believe I have answered your question.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

HI @Ankur Bawiskar 

this is working .Thanks 

only thing can we set the workflow not to trigger here instead of Approved.

Thanks