- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:28 AM
Hello All
Backgrouund Script :-
var gr = new GlideRecord('incident');
gr.get('00cddb02479ff95068c90a79116d4312'); //SYSID OF THE RECORD.
gr.business_service ='WARE'; //for business service
gr.setWorkflow(false);
gr.update();
Error :-
BUSINESS RULE - About to execute business rule 'incident query' on incident:<span class = "session-log-bold-text"> </span>
BUSINESS RULE - Finished executing business rule 'incident query' on incident:<span class = "session-log-bold-text"> </span>
BUSINESS RULE - About to execute business rule 'Track interaction for incident' on incident:<span class = "session-log-bold-text"> </span>
BUSINESS RULE - Skipping execution of Track interaction for incident on incident:<span class = "session-log-bold-text"> </span>; condition not satisfied: Condition: !!global.RP
Business Service is read only field but this script not working for me , anyone check this ?Thanks in Advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:37 AM
Try this
var gr = new GlideRecord('incident');
gr.get('00cddb02479ff95068c90a79116d4312'); //SYSID OF THE RECORD.
gr.setDisplayValue('business_service' , 'WARE'); //for business service
gr.setWorkflow(false);
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:37 AM
The 'business_service' field on task is not read-only OOB. So change that. Also, it is a reference field to the 'cmdb_ci_service' table, so you need to populate that field with the sys_id of the desired record in that table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:37 AM
Try this
var gr = new GlideRecord('incident');
gr.get('00cddb02479ff95068c90a79116d4312'); //SYSID OF THE RECORD.
gr.setDisplayValue('business_service' , 'WARE'); //for business service
gr.setWorkflow(false);
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:37 AM
Hello @1dusjhyahnt ,
Please try with the below code as your business_service may be a reference field.
var gr = new GlideRecord('incident');
gr.addQuery('00cddb02479ff95068c90a79116d4312'); //SYSID OF THE RECORD.
gr.query();
if(gr.next()){
gr.business_service.setDisplayValue('WARE'); //for business service
gr.setWorkflow(false);
gr.update();
}
If the above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.
Thank You!
Prathamesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:46 AM
Hello @1dusjhyahnt ,
Have you try with the above code? If the above code resolve your issue,
Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.
Thank You!
Prathamesh