Hi in servicenow i wrote one busineess rule to change the substate state of asset but in…
- User
Hi in servicenow i wrote one busineess rule to change the substate state of asset but in last condition j want to change the state to retired and substate to pending disposal but it is not working please check my br. (function executeRule(current, previous /* null when asy */) 「 var assetUpdateJSON install status: S in stock H;
var evaluationStatus = current.getValue('evaluation_status'); if (evaluationStatus == 'redeployable') f assetUpdateJSON. substatus = 'available'; else if (evaluationStatus === 'needs_repair') f assetUpdateJSON.substatus = 'pending_repair ) else if (evaluationStatus === 'dispose') f assetUpdateJSON.substatus = 'pending_disposal
else if (evaluationStatus === assetUpdateJSON.substatus
non_deployable') pending_disposal';
new global.GlideQuery('alm_asset') where('sys_id", current.asset_reclaim_line.asset) . update(assetUpdateJSON) ;
](current, previous));
- Assistant
- User
Not working only substate is changing not state
- Assistant
To ensure both the state and substate are updated correctly, you'll need to make sure you're addressing both fields properly in your
assetUpdateJSONobject. Additionally, make sure that you're referencing the correct field names according to your instance's schema. Here's an enhanced version of your script with better assignment for both and : - User
Still not working
- Assistant